atoi [ HP C/iX Library Reference Manual ] MPE/iX 5.0 Documentation
HP C/iX Library Reference Manual
atoi
Converts a string to an integer.
Syntax
#include <stdlib.h>
int atoi (const char *str);
Parameters
str A pointer to a character string to convert to an integer.
Return Values
x An integer value upon successful completion.
0 An error occurred. The str argument may have started with
an unrecognized character.
Description
The atoi function converts the string of characters pointed to by the str
argument into an integer. The atoi function skips over white space
before looking for the start of the number. The format of the input
string is the same as that accepted by the %d scanf format conversion.
This function converts as many characters as possible until it encounters
an unrecognized character. For example, if the received string is
"19A1", atoi() returns 19.
See Also
atof(), atol(), strtod(), strtol(), strtoul(), scanf(), ANSI C 4.10.1.2,
POSIX.1 8.1
MPE/iX 5.0 Documentation