to digit in c++ code example
Example 1: convert stirng to int c++
int thing = std::stoi(string);
Example 2: char to int c++
int x = (int)character - 48;
Example 3: c convert char to int
int i = (int)(c - '0');
int thing = std::stoi(string);
int x = (int)character - 48;
int i = (int)(c - '0');