我有以下代码:
type TRecord1 = record
myarr: array [0..31] of single:
end;
type TRecord2 = record
b1, b2, b3, b4, b5, b6: byte;
end;
type TRecord3 = record
myarr: array [0..31] of single:
b1, b2, b3, b4, b5, b6: byte;
end;
procedure TForm1.FormCreate(Sender: Tobject);
begin
ShowMessage(IntToStr(SizeOf(TRecord1))+'+'+IntToStr(SizeOf(TRecord2))+
'='+IntToStr(SizeOf(TRecord3)));
end;
该程序显示以下消息:
128+6=136
为什么
SizeOf(TRecord3)
的结果是 136 而不是 134?