## atoi

#### OS/161 Reference Manual

### Name

atoi - convert ascii to integer

### Library

Standard C Library (libc, -lc)

### Synopsis

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

### Description

string, which should be a textual representation of an integer, is converted to the machine representation of that integer. Leading whitespace, if any, is skipped. Conversion stops when a non-numeric character is found.

### Return Values

`atoi` returns the number converted. If no digits at all were found, it returns 0. If too many digits are found (resulting in overflow) the behavior is formally undefined.