turning a char to an int 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
int x = character - '0';
int x = '9' - 48;
// x now equals 9 as an integer