Considering using .c_str() and feeding it into atoi()
.c_str()
atoi()
Tips on taking a C++ string class object that only contains a number (e.g. "-200") and converting it into an int or double?
string
https://en.cppreference.com/w/cpp/string/basic_string/stol
https://en.cppreference.com/w/cpp/string/basic_string/stod
sorry that second link should be
https://en.cppreference.com/w/cpp/string/basic_string/stof
Thank you.
https://en.cppreference.com/w/cpp/string/basic_string/stol
https://en.cppreference.com/w/cpp/string/basic_string/stod
sorry that second link should be
https://en.cppreference.com/w/cpp/string/basic_string/stof
Thank you.