How to get the ASCII-decimal-value of an character?
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
Are there any functions in C++ to get an ASCII-decimal-value of an character? for example: IN = 'A' -> OUT = 65
-
Are there any functions in C++ to get an ASCII-decimal-value of an character? for example: IN = 'A' -> OUT = 65
Sure.
char c = 'A';
int val = c; // val equals 65
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-
Are there any functions in C++ to get an ASCII-decimal-value of an character? for example: IN = 'A' -> OUT = 65
atoi(char*) may work,if it does not, try to convert charvariable to char*. sprintf may be right function. dlfkgj lsdfkglfkgjlfgl jldfk fldkk jk