How to convert a string to integer in c++

How to convert a string to integer in c++

The stoi() function can be used for this

http://en.cppreference.com/w/cpp/string/basic_string/stol