Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SizeOf Function

Status
Not open for further replies.

gforrest

Programmer
Apr 26, 2000
39
CA
Hi,

I'm using the SizeOf Function to obtain the size of a record. I appear to get confusing results. Specifically, when I comment out a 'Char' the value of my Record drops by 4. I thought a 'Char' was only 1(??). If I comment out a 'Word' the value also drops by 4, which I would expect. Commenting out 'arrays of Char' creates even more confusing results.

Any one know why this might be happening?

Thanks.

 
It is relative to alignment . Try packed record!

TMyRec = packed record
CharType : Char;
WordType : Word;
end;

Regards!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top