Meaning of U suffix
Solution 1:
It stands for unsigned
.
When you declare a constant, you can also specify its type. Another common example is L
, which stands for long
. (and you have to put it twice to specify a 64-bit constant).
Example: 1ULL
.
It helps in avoiding explicit casts.
Solution 2:
Integer constants in C and C++ can optionally have several suffixes:
123u the value 123 is an unsigned int
123l (that's a lowercase L) 123 is a signed long
123L ditto
123uL unsigned long
123LL a signed long long, a 64 bit or 128 bit value (depending on the environment)
123uLL unsigned long long