随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

type
  TRec1 = record
    i: Integer;
    w: Word;
  end;

  TRec2 = packed record {压缩结构: 牺牲效率, 减小尺寸}
    i: Integer;
    w: Word;
  end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(IntToStr(SizeOf(TRec1))); {8}
  ShowMessage(IntToStr(SizeOf(TRec2))); {6}
end;

posted on 2008-01-09 13:15  万一  阅读(...)  评论(...编辑  收藏