std::cout cannot print uint8_t type data

std::cout outputs characters by default when processing uint8_t variable types. It happens that the ascii characters corresponding to the numbers 0-10 are not printable.

Solution:
usestatic_cast<int>

std::cout << static_cast<int>(time) << std::endl;

C++ detail: uint8_t cannot be printed with std::cout

Supongo que te gusta

Origin blog.csdn.net/weixin_45910027/article/details/132280674
Recomendado
Clasificación