Mouse wrote:
For instance, could one have a char of 16 bits,
an int of 21 bits and
a long of 29 bits?
Sort of.
You could have a char of 16 bits, an int of 21 significant and 11
insignificant bits, and a long of 29 significant and 3 insignificant
bits.
Good catch! I'd forgotten that integer types other than char and
unsigned char are allowed to have padding bits. That's covered in
section 6.2.6.2 of the ISO 9899:1999 standard. The no-padding
requirement for unsigned char is explicitly stated, and the no-padding
requirement for signed char follows from the that together with the
requirements on the range of values of the signed char type.