4 ms·
> and the Kalimba DSP coprocessor was even 24-bit char, short and ints Yes, but sizeof char would still be 1, unless I'm mistaken. I think I might have made a
by messe 6y ago
> and the Kalimba DSP coprocessor was even 24-bit char, short and ints
Yes, but sizeof char would still be 1, unless I'm mistaken.
I think I might have made a major pedagogical mistake when I declared char == 1 byte. What I meant was that when you're working in C, a char is the smallest addressable unit. Now, that smallest addressable unit is conventionally known as a byte, but it might not be 8-bits wide. These days it is almost always is thankfully.
Thank you for clarifying that, because I don't think my original comment was clear enough. I've been meaning for a while to write a blog post on the origins of 8-bit bytes as well as other conventions in CS.
- gens 6y agoEDIT: I was wrong, a char is always sizeof 1, See https://news.ycombinator.com/item?id=26131228 https://news.ycombinator.com/item?id=26131228 // old reply: I already replied to nanis above, so i+l just c/p it here. CHAR_BIT is a minimum of 1 byte (8 bits), but is not guaranteed to be 1. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf (Annex E)