ASCII to decimal

How would I convert a single ASCII character like 'A' 65 to its hex value 10?
Just cast it to an int:
cout << "Character 'a' is " << int('a') << " (decimal) and " << hex << int('a') << " (hex)" << endl;

http://www.cplusplus.com/reference/iostream/manipulators/hex/
Topic archived. No new replies allowed.