Solved

Convert CPP to C#

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i use linq for parsing string datetime to real datetime? 16 49
InputLanguage 1 33
List<PaisEntity> - show some 1 28
itextsharp with c# 3 5
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

839 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