> 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?
the compiler has probably optimized it to be word aligned.
i dont know for sure, but it may be the case that the
dragonball CPU requires all records to be on word boundaries
cheers
az.
--
Aaron Ardiri
Java Certified Programmer http://www.hig.se/~ardiri/
University-College i G�vle mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN
Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
Mob: +46 70 656 1143 A/H: +46 26 10 16 11