convert a character to integer in c code example
Example 1: turn a char into an int in c
int x = character - '0';
Example 2: converting char to integer c++
int x = '9' - 48;
// x now equals 9 as an integer
Example 3: c char to int
int i;
char c = 'A';
i = (int)c;