problem with uint32_t variables

i have declared a variable as
uint32_t num;
when i take input for this variable i.e
cin>>num;
cout<<num<<endl;
& take its cout, then it gives problem.

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.
It is working as expected. abcd is not part of a number, only 1234 is. What exactly were you expecting it to do?
You need to use the hex manipulator (#include <iomanip>) to do I/O with hexadecimal numbers.
Topic archived. No new replies allowed.