Declaration of a numeric constant as 'unsigned char'

In C/C++, 128U makes it unsigned int, 128UL makes it unsigned long, etc. What suffix will make it an unsigned char?
Last edited on
There are no such suffix.
The char literals are between quotes. You can assign them to char, signed char and unsigned char. The default type for that would be char, whether that is signed or unsigned depends on the compiler ( which may have some option to change the default behaviour ).
If you want to be sure that a literal is interpreted as unsigned char you'll have to explicitly cast it.
Topic archived. No new replies allowed.