atol() — Convert character string to long
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
ISO C |
both |
Format
#include <stdlib.h>
long int atol(const char *nptr);
General description
The atol() function
converts the initial portion of the string pointed to by nptr to
a 'long int'. This is equivalent to
strtol(nptr, (char**)NULL, 10)
Returned value
The atol() function returns the converted value if the value can be represented, otherwise the return value is undefined.