[Main]
Name=atoi
Type=Function
Subtype=tigcc.a
Header Files=stdlib.h
Definition=short atoi (const char *str);
Attributes=__attribute__((__pure__))

[Description]
Converts a string to a short integer.

[Explanation]
atoi converts the string pointed to by <I>str</I> to integer. atoi recognizes (in the
following order):
<UL>
<LI>an optional string of spaces [ws];</LI>
<LI>an optional sign ('+', '-', or special "small" minus used in TI-Basic) [sn];</LI>
<LI>a string of digits [ddd].</LI>
</UL>
The characters must match this generic format:
<BR><BR>
 [ws] [sn] [ddd]
<BR><BR>
In atoi, the first unrecognized character ends the conversion. There are no provisions for
overflow in atoi (results are wrong in a case of overflow). atoi returns the converted value
of the input string. If the string cannot be converted, the return value is 0. See
<A HREF="$$LINK(stdlib.h/strtol)">strtol</A> and <A HREF="$$LINK(stdlib.h/strtoul)">strtoul</A> for conversions which
allow much greater flexibility.
