Hello, I have a char variable, declared for example as:
char a = 's';
How can I get the ASCII code of this symbol?
Thank you.
Hello, I have a char variable, declared for example as:
char a = 's';
How can I get the ASCII code of this symbol?
Thank you.
a holds the ascii value of 's' (115). Think of a char as just a small integer. If you want it in an integer for whatever reason, just cast it.
char a = 's';
int code = a; //or (int)a;