<tt>long atol(char *s)</tt>

Document: The C Standard Library

next void exit(int status)
up Utility Functions: stdlib.h
gif int atoi(char *s)

long atol(char *s)

This takes a string representation of an integer (i.e. a string something like "145" or "-999999" or "25763178" etc.) and converts it into the corresponding internal representation of type long, which is the return value from the function. Leading white space in the string is ignored.

Again, the conversion will ignore any trailing data in the string, and the behaviour where the answer would overflow (i.e. be greater than LONG_MAX or less than LONG_MIN) is indeterminate; and if the conversion simply cannot be done (e.g. atol("")) the return value will be 0L.

Fri Mar 29 14:35:38 GMT 1996