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