Sorry all, I think I've found my answer.  Are all fields in structures
padded to 16-bit boundaries?  Does anyone know if there is #pragma pack or
something similar to change this?

James.

-----Original Message-----
From: James Nicholls [mailto:[EMAIL PROTECTED]]
Sent: Monday, 9 April 2001 16:21
To: Palm-Dev-Forum
Subject: Structure sizes


Hi all, I've got a structure defined in CodeWarrior C++ as:

struct T
{
  UInt32 f1 : 24;
  UInt8  f2;
};

This structure is meant to treat the first three bytes of memory as a unit
and the following byte as another unit inside of a 4 byte word.  sizeof(T)
== 6.  WHY DOESN'T EQUAL 4!!??

Frustrated James.


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to