4 ms·
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.
by ohyoutravel 10y ago
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.
- eps 10y agosizeof(char) is indeed 1. It's the CHAR_BIT that fluctuates (and we have a Cray compiler to prove it).
- ori_b 10y agoNote that POSIX defines CHAR_BIT as 8.
- plorkyeran 10y agosizeof(char) is inherently 1 because sizeof()'s unit is chars, not bits or bytes.