int atoi(const char * str);
Converts a string to an integer.
Parses the c string str and interprets its contents as an integer, which is returned as an int value.
This function first discards as many white space characters as possible until the first non-white space character is found. Then, starting from this character, take an optional initial plus or minus sign, followed by as many numbers as possible, and interpret them as a numerical value.
The string can contain other characters after the characters that make up the integer, and these characters will be ignored and have no effect on the behavior of the function.
If the first non-blank character sequence in str is not a valid integer, or there is no such sequence because str is empty or contains only blank characters, no conversion is performed.