char to hex help

Having trouble converting char to hex.

according to here
http://www.asciitable.com/
ô in decimal is 147 and print ô using alt 147

and here
http://www.ascii-code.com/
ô in dec is 244 but prints ⌠ using alt 244

put on console
1
2
char c = ô;
cout << (int)c << endl;

prints -109 and print m using alt -109

im using alt to test char output.

Why I'm getting a negative value? Which of the tables are correct?
I have string of char that I want to print in hex. I get a hex string but the hex value don't correspond to any of the two tables on the websites because the console converts special char to negative values.
Last edited on
closed account (3hM2Nwbp)
Perhaps you can use an 'unsigned char'?
Last edited on
thanks bro that worked! you're the best (:
Topic archived. No new replies allowed.