home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH06 / A06211.TXT < prev    next >
Encoding:
Text File  |  1993-10-18  |  588 b   |  10 lines

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