C standard library function
, supposedly for convert
ing a (decimal
into an int
It is generally not a good idea to use this function! What it really does is convert the initial segment of the string that is composed of digits (possibly preceded by a sign) to an int. In particular,
atoi("not a string") returns 0, not an indication of error.
strtol doesn't suffer from this problem.