atol

convert a string to long integer representation

Synopsis:

#include <stdlib.h>
long int atol( const char *ptr );

Description:

The atol() function converts the string pointed to by ptr to long int representation.

Returns:

the converted value

See also:

atoi(), itoa(), ltoa(), sscanf(), strtol(), strtoul(), ultoa(), utoa()

Examples:

#include <stdlib.h>

void main()
  {
    long int x;

    x = atol( "-289" );
  }

Classification:

ANSI

Systems:

All (except DOS/PM)