Why doesn't this code work?
int x; cin >> x;
With the input of 0x1a I get that x == 0 and not 26.
0x1a
x == 0
26
Why's that?
I believe in order to use hex you need to do something like this:
cin >> hex >> x; cout << hex << x;
you can also replace hex with dec and oct etc.
1.4m articles
1.4m replys
5 comments
57.0k users