Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASCII code 1

Status
Not open for further replies.

tvrtko

Programmer
Nov 26, 2003
53
HR
How to get ASCII code of character?

Thanks in advance.
 
Where do you want to get it?
in C language, data type 'char' is a numeric type, so either using debugger, or printing the value

Code:
printf("%d", cChar);

will provide you with the exact code of your character.

------------------
When you do it, do it right.
 
I need to save ASCII code of character in int variable.
Is there some function in c++ to do this?
 
Code:
char c = 'F';
int ascNum = c;
A char is just a 1 byte int.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top