Getting hex through Cin

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.

Leave a Comment