A
Alf P. Steinbach
The C++ FAQ item 29.5 (this seems to be strongly related to C), at
<url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
mentions that
<quote>
C++ guarantees a char is exactly one byte which is at least 8 bits, short
is at least 16 bits, int is at least 16 bits, and long is at least 32
bits.
</quote>
Questions:
(1) This guarantee seems to come from the C standard. Which I don't
have. Does the C++ standard really guarantee this?
(2) Is this guarantee originally formulated in terms of number of bits,
or in terms of e.g. decimal value ranges?
(3) Concerning (2), if formulated in terms of number of bits, are the number
of bits mentioned simply sizeof(T)*CHAR_BIT, which doesn't say much about
value ranges, or are they stated to be the value representation bits?
(Intentionally cross-posted [comp.lang.c++] and [comp.lang.c]).
<url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
mentions that
<quote>
C++ guarantees a char is exactly one byte which is at least 8 bits, short
is at least 16 bits, int is at least 16 bits, and long is at least 32
bits.
</quote>
Questions:
(1) This guarantee seems to come from the C standard. Which I don't
have. Does the C++ standard really guarantee this?
(2) Is this guarantee originally formulated in terms of number of bits,
or in terms of e.g. decimal value ranges?
(3) Concerning (2), if formulated in terms of number of bits, are the number
of bits mentioned simply sizeof(T)*CHAR_BIT, which doesn't say much about
value ranges, or are they stated to be the value representation bits?
(Intentionally cross-posted [comp.lang.c++] and [comp.lang.c]).