uint8_t can't be printed with cout

前端 未结 8 2257

I have a weird problem about working with integers in C++.

I wrote a simple program that sets a value to a variable and then prints it, but it is not working as expe

8条回答
  •  野的像风
    2020-11-21 13:44

    cout is treating aa as char of ASCII value 5 which is an unprintable character, try typecasting to int before printing.

提交回复
热议问题