convert char to int in cp code example Example: converting char to integer c++ int x = '9' - 48; // x now equals 9 as an integer