atol


Conversion of character string to integer (long int type)

[Classification]

Standard library

[Syntax]

#include <stdlib.h>

long int __far atol(const char __near *nptr);

long int __far _COM_atol_f(const char __far *nptr);

[Return value]

Returns the converted value if the partial character string could be converted. If it could not, 0 is returned.

If an overflow occurs, atol returns LONG_MAX for a positive value and LONG_MIN for a negative value, and sets macro ERANGE to global variable errno.

[Description]

This function converts the first part of the character string indicated by nptr into a long int type in the decimal representation.