Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I declare a struct (of array) in C#?

Status
Not open for further replies.

hienmt

Programmer
Oct 31, 2002
1
VN
I have a struct in C++ like this:(and ofcourse I want to keep the length of struct fixed)
typedef struct tagDATA{
char name[16];
HEAD2 hd2;// this is a struct
char Cap[256];
int Mount;
int V[8];
double A[8],AH[8],Q[8],W[8],Wat[8];
char Sub[8][32];
int n_s;
BOOL Active;
}DATA;
How can I translate it into C#?

And a struct like this:
typedef struct tagPAR{
short VS;
short rs1;
short rs2;
double Gain;
}PAR; // size= 14 bytes
How can I convert this struct to byte[] array?
Please Help me!
Hien
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top