There is no ostream<< for uint8_t. Therefore, the compiler picks some of the existing overloads. Perhaps char
.
Easy to test. What does uint8_t num8 = 'r';
print with stream?
Explicit casting of num8 to (larger) numeric type would guide the selection of the <<.
Thank you keskiverto, explicit casting worked.
1 2 3 4 5 6 7 8 9
|
#include <iostream>
#include <inttypes.h>
int main()
{
uint8_t num8 = 8;
std::cout << "start>>" << (int)num8 << "<<end" << std::endl;
}
|
Last edited on