#include <stdlib.h>
int atoi (
char *string); /* string to convert */
Description
The atoi function converts string into
an integer value. The input string must be a
sequence of characters that can be interpreted as an integer. This
function stops processing characters from string
at the first one it cannot recognize as part of the number.
The string passed to atoi must have the
following format:
〚whitespace〛〚{+|-}〛 digits
Where
whitespace
May be any number of space(' '), tab ('\t'),
newline ('\n'), or carriage return ('\r') characters.
digits
May be one or more decimal digits.
Return Value
The atoi function returns the integer value that is
produced by interpreting the characters in string
as a number.
If no conversion could be performed, 0 is returned.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.