Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate C struct to Delphi record

I would like to know how to convert C struct to Delphi record?

The following code is in C. I want to convert to Delphi.

typedef struct
  {
  Uint16        value1[32];
  Uint16        value2[22];
  Uint16        value3[8];    
  }MY_STRUCT_1;

Thanks in advance.

like image 419
sMah Avatar asked Jan 27 '12 04:01

sMah


1 Answers

The Uint16 is equivalent to the Word type and the [] indicates an array.

MY_STRUCT_1 = record
  value1 : Array [0..31] of Word;
  value2 : Array [0..21] of Word;
  value3 : Array [0..7] of Word;
end;
like image 141
RRUZ Avatar answered Sep 24 '22 17:09

RRUZ