I have a char variable with the character 'a' in it. How can i find the ASCII value of this?
p.s. I know its the ASCII value of 'a', but i need to use my program to find it.
Printable View
I have a char variable with the character 'a' in it. How can i find the ASCII value of this?
p.s. I know its the ASCII value of 'a', but i need to use my program to find it.
In C/C++, you can simply cast a char to an int in order to see it's character code.
Hope this helps.Code:char c = 'a';
cout << "the code for " << c << " is: " << (int)c << endl;
That helps, thanks.Quote:
Originally Posted by sunburnt