There are some new convert methods in C++ that convert std::string to a numeric type.
As an alternative to
str.c str() atoi(str.c str()) atoi(str.c str()
you can make use of
std::stoi std::stoi std::s ( str )
where str is your std::string number.
There are versions for all types of integers, including
long stol(string), float stof(string), and double stod(string) (string)