Syntax
#include <stdlib.h>
long atol(const char *string)
Arguments
string pointer to the character string to be converted
Return Value
A numeric value of the long type
Description
It converts a character string to a numeric value of the long type by parsing the character string as follows:
[whitespace][{sign}][digits]
- <whitespace>
- a space, NULL character, or tab character
- <sign>
- + or -
- <digits>
- a decimal character string with more than one digit
Conversion is terminated when an unrecognizable character appears as part of the number.