strtol(3) parses the string as 'long' and long is 64-bit on amd64, and int is 32-bit, so they can't be equivalent. > DESCRIPTION > The atoi() function converts the initial portion of the string pointed to > by nptr to int representation. > > It is equivalent to: > > (int)strtol(nptr, (char **)NULL, 10); > > The atoi() function has been deprecated by strtol() and should not be > used in new code.
The implementation of atoi() is literally: int atoi(const char *str) { return (int)strtol(str, NULL, 10); } so this statement is entirely correct.