parse int c++ code example
Example 1: c++ parse int
std::string s = "10";
int i = std::stoi(s);
Example 2: c++ string to int
atoi( str.c_str() )
Example 3: string to int c++
// Both functions work identically though you'll need to use "#include <string>"
atoi( str.c_str() );
stoi( str );