开发者

how to take input for uint32_t variable

开发者 https://www.devze.com 2023-01-01 01:58 出处:网络
i have declared a variable as uint32_t num; when i take input for this variable i.e cin>>num; cout< when i run this program, i gives num value as 12345678, it works fine & give cout. but when

i have declared a variable as uint32_t num; when i take input for this variable i.e cin>>num; cout<

when i run this program, i gives num value as 12345678, it works fine & give cout. but when i give input as 1234a开发者_C百科bcd. it creates problem & displays only 1234. please suggest solution to resolve this problem.


Use std:: cin >> std::hex >> num; if you want to read hex numbers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号