Re: how to pack bitfields and make it cross container boundry
- From: "Simon Trew" <noneofyour@xxxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 11:01:11 -0000
Just a guess-- have you tried a char pack: 6 afterwards? It may be that,
given the luxury of using 16 bits anyway, the compiler decides to put b onto
a byte boundary, but if you use up all 16 bits, it will squeeze b closer to
a.
Worth a try I'd have thought.
S.
"Lokicer" <lokicer@xxxxxxx> wrote in message
news:OL2ZLAzTGHA.4080@xxxxxxxxxxxxxxxxxxxxxxx
hi,
i build a bitfield structure and pack it as following
#pragma pack(1)
typedef struct
{
char a:5;
char b:5;
} test_t;
#pragma pack()
i want b follows a closely and try it in vc++6, but there is 3 bits space
between a and b.
how to make bitfield corss byte boundry?
thanks in advance
Lokicer
.
- References:
- Prev by Date: how to pack bitfields and make it cross container boundry
- Next by Date: Re: how to pack bitfields and make it cross container boundry
- Previous by thread: how to pack bitfields and make it cross container boundry
- Next by thread: Re: how to pack bitfields and make it cross container boundry
- Index(es):
Relevant Pages
|