home *** CD-ROM | disk | FTP | other *** search
- The structure Shrink has three data members packed into 8 bits of
- memory. To declare a member as a bit field, do not specify a type
- before its name. The name is followed by a colon and the number
- of bits in that field. In this example, the member "one" occupies
- 1 bit, the member "two" occupies 2 bits, and the member "three"
- occupies 5 bits. Each bit field is of integral type, and you can
- declare it to be signed or unsigned. Whether the default is
- signed or unsigned depends on your C++ implementation. Here, you
- know only that the member "one" does not include a sign.
-