according documentation:
On success, the function returns the converted integral number as a long int value. If no valid conversion could be perfor
IMHO, I prefer sscanf() to atoi() or strtol(). The main reason is that you cannot reliably check for error status on some platforms (i.e. Windows) unless you use sscanf() (which returns 1 if you succeed, and 0 if you fail).
sscanf()
atoi()
strtol()
1
0