I can specify an integer literal of type unsigned long as follows:
const unsigned long example = 9UL;
How do I do likewise for an unsigned
The question was how to "specify an integer 'literal' of type unsigned char in C++?". Not how to declare an identifier.
You use the escape backslash and octal digits in apostrophes. (eg. '\177')
The octal value is always taken to be unsigned.
I suppose '\0'
would be a char literal with the value 0, but I don't see the point either.
Assuming that you are using std::min
what you actually should do is explicitly specify what type min
should be using as such
unsigned char example2 = 0;
min<unsigned char>(9, example2);