What is the difference between atol() & strtol()?
According to their man pages, they seem to have the same effect as well as matching arguments:
If memory serves, strtol() has the added benefit to set the (optional) endptr to point to the first character that could not be converted. If NULL, it is ignored. That way if you're processing a string containing numbers and characters mixed, you could continue.
e.g.,
char buf[] = "213982 and the rest";
char *theRest;
long int num = strtol(buf, &theRest, 10);
printf("%ld\n", num); /* 213982 */
printf("%s\n", theRest); /* " and the rest" */