cout print hex instead of decimal

后端 未结 2 1812
时光取名叫无心
时光取名叫无心 2020-12-21 01:46

has it occurred to anyone that a simple std::cout might print a value in hex format when it is supposed to format just a decimal(like an integer)?

for e

2条回答
  •  一个人的身影
    2020-12-21 02:20

    You probably have set std::cout to print hex in prior in the context of your code but forget to reset. For example:

    std::cout<

    so you have to do like the following

    std::cout<

    to print in decimal form.

提交回复
热议问题