4 ms·
I thought that because the C standard requires sizeof(char) to be 1, CHAR_BIT cannot be anything other than 8, unless the architecture is redefining what 'byte'
by optymizer 3y ago
I thought that because the C standard requires sizeof(char) to be 1, CHAR_BIT cannot be anything other than 8, unless the architecture is redefining what 'byte' means.
- mtklein 3y agoThat's right, char in C doesn't necessarily mean an 8-bit byte. There are modern architectures where there is no 8-bit type and CHAR_BIT is 16.
- johannes1234321 3y agoThe possibility for a byte to be something other than 8 bit is the reason, why some people refer to 8 bit as octet in network protocols etc. I think I remember somebody pointing to such a machine in some special area (Telco?) still in use in a previous discussion here ... but if that still exists it's very very rare and mostly historical.
- dagmx 3y agoSeveral DSPs don’t use 8 bit chars https://stackoverflow.com/a/2098444 https://stackoverflow.com/a/2098444