Question: how to do atoi in c++?
Answer: #include <cstdlib> int atoi( const char *str ); The atoi() function converts str into an integer, and returns that integer. str should start with a whitespace or some sort of number, and atoi() will stop reading from str as soon as a non-numerical character has been read.