开发者

how to take input for uint32_t variable

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜