c和delphi类型转换(50分)

X

xywen

Unregistered / Unconfirmed
GUEST, unregistred user!
如何将C中的结构转化为DELPHI中的 RECORD(类型)?
typedef unsigned char dpl_uint8_t;
typedef unsigned short dpl_uint16_t;
typedef unsigned int dpl_uint32_t;
typedef signed char dpl_int8_t;
typedef signed short dpl_int16_t;
typedef signed int dpl_int32_t;
struct cmppe_login{
char id[12];
char auth[12];
dpl_uint8_t type;
dpl_uint8_t version;
dpl_uint32_t timestamp;
}
 
这个如何?
type
dpl_uint8_t = Byte;
dpl_uint16_t = Word;
dpl_uint32_t = Word;
dpl_int8_t = Char;
dpl_int16_t = SmallInt;
dpl_int32_t = Integer;

type
cmppe_login = record
id: Array[0..11] of Char;{试验一下11或者12}
auth: Array[0..11] of Char;
type: DPL_UINT8_T;
version: DPL_UINT8_T;
timestamp: DPL_UINT32_T;
end {cmppe_login};
 
type
dpl_uint8_t=byte;
dpl_uint16_t=word;
dpl_uint32_t=Cardinal;
dpl_int8_t=shortint;
dpl_int16_t=smallint;
dpl_int32_t=integer;
type
cmppe_login=record
id:array [0..11] of char;
auth:array [0..11] of char;
ctype:dpl_uint8_t;
version:dpl_uint8_t;
timestamp:dpl_uint32_t;
end;
 
接受答案了.
 
本人郑重声明,从今以后永远不回答你的问题![:(!]
失去了一种公平的环境,没有起码的对人的尊重……
 
顶部