atoi() — Convert character string to integer

Standards

Standards / Extensions C or C++ Dependencies

ISO C
POSIX.1
XPG4
XPG4.2
C99
Single UNIX Specification, Version 3

both  

Format

#include <stdlib.h>

int atoi(const char *nptr);

General description

The atoi() function converts the initial portion of the string pointed to by nptr to a 'int'. This is equivalent to
(int)strtol(nptr, NULL, 10)

Returned value

There are no documented errno values.

Related information