Solved

Convert CPP to C#

Posted on 2014-04-19
2
388 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

895 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now