If you have the following code:
cout << hex << 10;
The output is 'a', which means the decimal 10 is converted into its hexadecimal value.
However, in the code below...
int n;
cin >> hex >> n;
cout << n << endl;
When input is 12, the output becomes 18. Can anyone explain the details of the conversion? How did it became a decimal value?
I'm interested in the point where it became an int. If broken down, it would be:
(( cin >> hex ) >> n);
Is this correct?