Everything

atol


Converts a decimal-representing string to a long type integer.

[Format]

#include <stdlib.h>

long atol (const char *nptr);

[Parameters]

nptr Pointer to a number-representing string to be converted

[Return values]

Converted data as a long type integer

[Remarks]

If the converted result overflows, errno is set.

Data is converted up to the first character that does not fit the decimal data type.

The atol function does not guarantee the return value if an error such as an overflow occurs. When you want to acquire the guaranteed return value, use the strtol function.