|
||
int atoi( char *s )
char *s; /* string to be converted */
|
|
|
Synopsis |
#include "stdlib.h"
The atoi function returns the value of an ASCII text string representation of an integer. atoi stops reading the input string at the first character that it cannot recognize as part of a number.
|
|
Parameters |
s should be a null-terminated string with the following format:
[whitespace][sign][digits]
where [whitespace] is a sequence of tab or space characters, [sign] is either plus ('+') or minus ('-'), and [digits] is one or more decimal digits.
|
|
Return Value |
If s is empty, or no digits are found, then atoi returns 0. If the result overflows, then the return value is undefined.
|
|
See Also |
|
|
|
|