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.
2.1m questions
2.1m answers
60 comments
57.0k users