Click to See Complete Forum and Search --> : Hexadecimal as default


Grettir
10-07-2003, 01:56 AM
ay everybody whats up
i was just wondering, is there a way in C++ to set the default display/read as hexadecimal. i know about setting hex(cin) and hex(cout), and cout<<hex<<blabla, but i want to be able to say

int x = F;

and the program understands that im talking im talking about 15, not the letter F
thanks everyone!

infidel
10-07-2003, 04:52 AM
Greetings,

Just precede the 'F' with '0x', like:
int x = 0xF;