#include <stdlib.h>
long atol (const char *nptr);
long atol
The atol function converts the initial portion of the string pointed to by nptr to long int representation. Except for the behavior in error, it is equivalent to
strtol (nptr, (char **)NULL, 10)
The atol function returns the converted value.