// convert string to int number. int number = stoi(str) int number = stoi(str,nulptr,10);//base 10 int number = stoi(str.c_str());