use stoi to convert to base 10 code example
Example 1: c++ string to int
atoi( str.c_str() )
Example 2: c++ string to int
// EXAMPLE
std::string sStringAsString = "789";
int iStringAsInt = atoi( sStringAsString.c_str() );
/* SYNTAX
atoi( <your-string>.c_str() )
*/
/* HEADERS
#include <cstring>
#include <string>
*/