473,378 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

c++ to C# using structs

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

typedef struct
{
int ID;
char ProfitCenter[21];
} REPORTSPROFITCENTERS;
REPORTSPROFITCENTERS myReportsProfitCenters[100]
Nov 15 '05 #1
2 1138
this may solve your problem,

struct REPORTSPROFITCENTERS
{
int ID;
string ProfitCenter;
}
REPORTSPROFITCENTERS[] myReportsProfitCenters = new
REPORTSPROFITCENTERS[100];
"markg" <ma***@commeg.com> wrote in message
news:c0****************************@phx.gbl...
Hi what is the equivalent in c# for this? Thanks

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

Nov 15 '05 #2
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/de...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."

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sourin | last post by:
Hi all, I am trying to write code for my experiments. My work involves huge datasets, and as such my code needs to be memory efficient. I did some hand calculations regarding the amount of...
8
by: Mas L via DotNetMonster.com | last post by:
Hi, I have a c++ source code which I can compile to be a DLL (in VS.NET 2003). And I need to use it in a C# program. After I compiled/build the C++ code to a DLL, I add it as a Reference in my...
5
by: Bilgehan.Balban | last post by:
Hi, I am currently brushing up my c++ knowledge and I would like to ask you about the differences between classes and C structs, in the function/method perspective. 1) Is it correct to say...
61
by: Marty | last post by:
I am new to C# and to structs so this could be easy or just not possible. I have a struct defined called Branch If I use Branch myBranch = new Branch(i); // everything works If I use Branch...
6
by: DaTurk | last post by:
Hi, I'm coding a layer into my application using CLI, between a unmanaged and a c# layer. So, I have to marshal some unmanaged c++ structures to structures usable in c#. My solution was to...
6
by: titan nyquist | last post by:
Can I step through a struct using foreach? I want a method that steps through a struct, and prints out the name/value of each member. Can it be done? The error I get when trying this is: ...
29
by: Dom | last post by:
I'm really confused by the difference between a Struct and a Class? Sometimes, I want just a group of fields to go together. A Class without methods seems wrong, in that it carries too much...
43
by: JohnQ | last post by:
Are a default constructor, destructor, copy constructor and assignment operator generated by the compiler for a struct if they are not explicitely defined? I think the answer is yes, because...
1
by: radskate360 | last post by:
Hi I am newer to programming and need a bit of help with this program. OK, heres the directions. The distance between two places on earth can be calculated by using their latitudes and...
2
by: =?Utf-8?B?U2V0aEluTUk=?= | last post by:
I am a total newb at .net, and I have not been able to search out a best practice answer to what must be a common problem. My app must process binary data from a UDP socket, a MSMQ queue and a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.