[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Convert CPP to C#

Posted on 2014-04-19
2
Medium Priority
?
402 Views
Last Modified: 2014-04-19
Hi..
Any idea how I can convert this to C#

struct extrema {
    int *mins, *maxes;
    extrema();
    ~extrema();
    void alloc(int size);
    void dealloc();
    void update(point prev, point cur);
} horizExtrema, vertExtrema;


I think it's something like  ?????

public class extrema
{

      public int mins;

      public int maxes;

      void update(point prev, point cur);
}
0
Comment
Question by:JElster
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 40010371
IMO that should be more like

public class extrema
{

      public int[] mins;

      public int[] maxes;

      public void alloc(int size)
      {
          mins = new int[size];
          maxes= new int[size];
      }
      // void dealloc(); <-- not needed in C#
      void update(point prev, point cur); // what is 'point' like?
} 

Open in new window

0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 40010459
Just to add to the last post. I imagine point would be System.Drawing.Point.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question