How do you convert letters to ascii characters you know,
like 'A' to 45 and stuff like that?
Printable View
How do you convert letters to ascii characters you know,
like 'A' to 45 and stuff like that?
Just cast to an integer - in C, all characters are numbers anyway :)Code:char a = 'A';
int code = (int)a;
It worked, great, thanks, but how do you convert it back? would it be:
int a = '45';
char letter = (char)a;
???
Nearly:
Code:int a = 45; /* no quotes */
char letter = (char)a;