HS> This should expand your knowledge abit..
HS>
HS> struct bit_field
HS> {
HS> int bit0 : 1;
HS> int bit1 : 1;
HS> int bit2 : 1;
HS> int bit3 : 1;
HS> int bit4 : 1;
HS> int bit5 : 1;
HS> int bit6 : 1;
HS> int bit7 : 1;
Why not do bit-wise manipulation and create a bit_array class?
Allocate a buffer of char (you may have 7 wasted bits) and calculate
which character has the 31st bit and the offset of that bit within
that char. Overload the [] operator and walla: You can know store
8 boolean values per character. 800 booleans = 100 bytes(?)
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|