Hacker News new | ask | show | jobs
by bruno2 4592 days ago
I have found a mistake: In table 9.1 of chapter 9 "Data types and Conversion" you wrote that the char data type ranges from -128 to 127, but that's not true, because the standard doesn't say that a char is signed or unsigned, it depends on the implementation. A char can be an unsigned char and in that case it will range from 0 to 255.
1 comments

Thanks, I'll add it to the tracker.
A char also isn't guaranteed to be 8 bits. POSIX requires it, but in ISO C++, a char can be as large as a long long int (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n333..., section 3.9.1, paragraph 2)