char
takes values in the range of -128 to 127.
No.
char
is implementation-defined, it could be either signed char
or unsigned char
depending on what your compiler chose to use. And char
doesn't necessarily means byte
BTW... (there are some platforms where a char
is 16 bits for example)
If you want to ensure that a char
is indeed an unsigned char
then just cast it: static_cast<unsigned char>(some_char_value)