I need a function that returns the ASCII value of a character, including spaces, tabs, newlines, etc...
On a similar note, what is the function that converts between
You may be confusing internal representation with output. To see what value a character has:
char c = 'A';
cout << c << " has code " << int(c) << endl;
Similarly fo hex valuwes - all numbers are hexadecimal numbers, so it's just a question of output:
int n = 42;
cout << n << " in hex is " << hex << n << endl;
The "hex" in the output statement is a C++ manipulator. There are manipulators for hex and decimal (dec), but unfortunately not for binary.