3 ms·
I always thought that 1 char was exactly 1 byte, but that 1 byte was not necessarily 8 bits?
by Sean1708 8y ago
I always thought that 1 char was exactly 1 byte, but that 1 byte was not necessarily 8 bits?
- saagarjha 8y agoI think from a C standards point of view, that's true; I was using the general convention of 1 byte=8 bits, but char being one or more of these bytes. Hence CHAR_BIT is the number of bits in a char, and sizeof gives the number of chars that would fit in the specified type.