c++ to C# using structs

  • Thread starter Thread starter markg
  • Start date Start date
M

markg

Hi what is the equivalent in c# for this? Thanks

typedef struct
{
int ID;
char ProfitCenter[21];
} REPORTSPROFITCENTERS;


REPORTSPROFITCENTERS myReportsProfitCenters[100]
 
this may solve your problem,

struct REPORTSPROFITCENTERS
{
int ID;
string ProfitCenter;
}
REPORTSPROFITCENTERS[] myReportsProfitCenters = new
REPORTSPROFITCENTERS[100];
 
Hi markg,

Thank you for posting in the community!

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to convert your c++ code to
c#. If there is any misunderstanding, please feel free to let me know.

Thanks for Burke's quick response. The code Burke provided is quite right.
For more information about how to define a structure in c#, here is a
tutorial for your reference.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/
vcwlkstructstutorial.asp

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top