S
seagod007
Unregistered / Unconfirmed
GUEST, unregistred user!
我在做串口通信程序时约定了84个字节的接口协议,在DELPHI 6下严格按类型的大小定义了如下
的记录结构,可是拆开来计算大小都是对的,比如Smallint是2字节,Longint是4字节,但是
在计算这个结构大小时确总是得到92字节,不知道哪多出了8个字节,请大家帮忙看看。
TDateRec = record
StartCode: Smallint;
DateTypeCode: Smallint;
RecordLength: Smallint;
EquipmentCode: array [0..29] of char;
AimCode: array [0..9] of char;
SerialNumber:Longint;
DateType: Shortint;
Validity: Smallint;
Hour: Shortint;
Minute: Shortint;
Second: Shortint;
Millisecond: Smallint;
Longitude: Longint;
Latitude: Longint;
Azimuth: Smallint;
Course: Smallint;
Speed: Smallint;
Warp: Smallint;
X: Longint;
Y: Longint;
Z: Smallint;
EndCode: Smallint;
end;
的记录结构,可是拆开来计算大小都是对的,比如Smallint是2字节,Longint是4字节,但是
在计算这个结构大小时确总是得到92字节,不知道哪多出了8个字节,请大家帮忙看看。
TDateRec = record
StartCode: Smallint;
DateTypeCode: Smallint;
RecordLength: Smallint;
EquipmentCode: array [0..29] of char;
AimCode: array [0..9] of char;
SerialNumber:Longint;
DateType: Shortint;
Validity: Smallint;
Hour: Shortint;
Minute: Shortint;
Second: Shortint;
Millisecond: Smallint;
Longitude: Longint;
Latitude: Longint;
Azimuth: Smallint;
Course: Smallint;
Speed: Smallint;
Warp: Smallint;
X: Longint;
Y: Longint;
Z: Smallint;
EndCode: Smallint;
end;