uint8_t iostream behavior

前端 未结 3 2188
误落风尘
误落风尘 2020-12-10 12:48

Abstract: I was expecting the code: cout << uint8_t(0); to print \"0\", but it doesn\'t print anything.

Long version: When I try to stream uint8_t objects

3条回答
  •  轮回少年
    2020-12-10 13:22

    uint8_t is an alias for unsigned char, and the iostreams have special overloads for chars that print out the characters rather than formatting numbers.

    The conversion to integer inhibits this.

提交回复
热议问题