Garry,

    This is normal the sizeof a structure may be larger than the sizeof 
it's parts due to word boundary allignment.

Ron

<pre>
Hi all,

This seems basic but somehow I got different answer for it:

typedef struct 
{
   Char         cFieldName[16];
   Char  cFieldType;
   Word wFieldAttribute;
   Word wFieldLength;
   UChar cFieldDecimal;
   UChar ucFieldOffset;
} FIELD_DEF;

I sizeof all the structure members and it returns me 23.
sizeof(FIELD_DEF) will return me 24 bytes, instead of 23.
Why is it so? Where does the one extra byte come from?

Thanks,
garry



</pre>


Reply via email to