I've declared a uint8 variable and when the value in it is printed, I get smiley faces and white spaces. Shouldn't it display integer values?
I bet uint8
is a typedef
for unsigned char
in your system headers. Then std::cout << u
will print symbols rather than integer values, where u
is of type uint8
.
Try
std::cout << static_cast< int >( u );
or
std::cout << +u;
to have numeric values printed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With