int number = std::stoi(string, base); // str to int int number = std::stoi("100",10); // number = 100 long int number = std::strtol(string, endptr, base); // str to long int