0

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 1234abcd. it creates problem & displays only 1234. please suggest solution to resolve this problem.

user349146
  • 39
  • 1
  • 3

1 Answers1

2

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

nc3b
  • 15,562
  • 5
  • 51
  • 63