72 lines
1.6 KiB
HTML
72 lines
1.6 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>atof(3)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>atof(3)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
atof, atoi, atol - convert ASCII to numbers
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><stdlib.h></STRONG>
|
|
|
|
<STRONG>double</STRONG> <STRONG>atof(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>nptr</EM><STRONG>)</STRONG>
|
|
<STRONG>int</STRONG> <STRONG>atoi(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>nptr</EM><STRONG>)</STRONG>
|
|
<STRONG>long</STRONG> <STRONG>atol(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>nptr</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
These functions convert a string pointed to by <EM>nptr</EM> to floating, integer,
|
|
and long integer representation respectively. The first unrecognized
|
|
character ends the string.
|
|
|
|
<STRONG>Atof</STRONG> recognizes an optional string of spaces, then an optional sign, then
|
|
a string of digits optionally containing a decimal point, then an
|
|
optional `e' or `E' followed by an optionally signed integer.
|
|
|
|
<STRONG>Atoi</STRONG> and <STRONG>atol</STRONG> recognize an optional string of spaces, then an optional
|
|
sign, then a string of digits.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man3/strtol.3.html">strtol(3)</A></STRONG>, <STRONG><A HREF="../man3/strtod.3.html">strtod(3)</A></STRONG>, <STRONG><A HREF="../man3/scanf.3.html">scanf(3)</A></STRONG>.
|
|
|
|
|
|
</PRE>
|
|
<H2>BUGS</H2><PRE>
|
|
There are no provisions for overflow.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|