Re:So you think you know C?
by ohyoutravel on Tuesday November 08, 2016 @02:40PM
(#12903294)
Is this true? I thought the C99 standard just specified that the guaranteed minimum size is 1 byte. I've been using CHAR_BIT to define this.
[ Parent
| on HN ]
sizeof(char) is indeed 1. It's the CHAR_BIT that fluctuates (and we have a Cray compiler to prove it).
Note that POSIX defines CHAR_BIT as 8.
Re:So you think you know C?
by plorkyeran on Tuesday November 08, 2016 @03:10PM
(#12903515)
sizeof(char) is inherently 1 because sizeof()'s unit is chars, not bits or bytes.