xref: /csrg-svn/lib/libc/stdlib/atoi.3 (revision 48349)
1*48349Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
242105Sbostic.\" All rights reserved.
342105Sbostic.\"
442105Sbostic.\" %sccs.include.redist.man%
542105Sbostic.\"
6*48349Scael.\"     @(#)atoi.3	5.2 (Berkeley) 04/19/91
742105Sbostic.\"
8*48349Scael.Dd
9*48349Scael.Dt ATOI 3
10*48349Scael.Os
11*48349Scael.Sh NAME
12*48349Scael.Nm atoi
13*48349Scael.Nd convert
14*48349Scael.Tn ASCII
15*48349Scaelstring to integer
16*48349Scael.Sh SYNOPSIS
17*48349Scael.Fd #include <stdlib.h>
18*48349Scael.Ft int
19*48349Scael.Fn atoi "const char *nptr"
20*48349Scael.Sh DESCRIPTION
2142105SbosticThe
22*48349Scael.Fn atoi
2342105Sbosticfunction converts the initial portion of the string pointed to by
24*48349Scael.Em nptr
2542105Sbosticto
26*48349Scael.Em integer
2742105Sbosticrepresentation.
28*48349Scael.Pp
2942105SbosticIt is equivalent to:
30*48349Scael.Pp
31*48349Scael.Bd -literal -offset indent
3242105Sbostic(int)strtol(nptr, (char **)NULL, 10);
33*48349Scael.Ed
34*48349Scael.Sh SEE ALSO
35*48349Scael.Xr atof 3 ,
36*48349Scael.Xr atol 3 ,
37*48349Scael.Xr strtod 3 ,
38*48349Scael.Xr strtol 3 ,
39*48349Scael.Xr strtoul 3
40*48349Scael.Sh STANDARDS
41*48349ScaelThe
42*48349Scael.Fn atoi
43*48349Scaelfunction conforms to
44*48349Scael.St -ansiC .
45