atoi

convert a string to integer representation

Synopsis:

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

Description:

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

Returns:

the converted value

See also:

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

Examples:

#include <stdlib.h>

void main()
  {
    int x;

    x = atoi( "-289" );
  }

Classification:

ANSI

Systems:

All (except DOS/PM)