Struct usage and varying sizes of h, l, etc

sjdevnull at yahoo.com sjdevnull at yahoo.com
Wed May 21 15:23:14 EDT 2008


On May 21, 10:04 am, Grant Edwards <gra... at visi.com> wrote:
> Yes, C defines "char" to be one byte, but it doesn't define the
> size of a "byte" other than it's at least big enough to hold
> one character (or something like that).  In practice, a byte is
> pretty much guaranteed to be at least 8 bits.

If you're discussing standard C, you can omit "in practice" and
"pretty much".  CHAR_BITS is required to be at least 8 by the ANSI/ISO
C Standard.

> But, on some targets a "byte" is 16 bits, and on others a byte
> is 32 bits.

Yep, or 9 bits or 36 bits, or anything >= 8.



More information about the Python-list mailing list