atol()

convert string to a long integer 

Function


SYNOPSIS

#include <stdlib.h>

long atol(const char *nptr);


DESCRIPTION

The atol() function converts a string representing an integer to a long integer. The string to be converted consists of optional leading white space, an optional sign and a series of contiguous digits.

The call atol(nptr) is equivalent to:

strtol(nptr,(char **)NULL, 10)

PARAMETERS

nptr 

Points to a string to be converted to a long.


RETURN VALUES

The atol() function returns the converted long value.

If the converted value overflows, LONG_MIN or LONG_MAX is returned (according to the sign of the value) and errno is set to ERANGE. If no character could be converted, zero is returned.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
atoi(), strtol()


MKS Toolkit 9.2 Documentation Build 16.