xref: /original-bsd/lib/libc/stdlib/atoi.3 (revision c3e32dec)
1.\" Copyright (c) 1990, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the American National Standards Committee X3, on Information
6.\" Processing Systems.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"     @(#)atoi.3	8.1 (Berkeley) 06/04/93
11.\"
12.Dd
13.Dt ATOI 3
14.Os
15.Sh NAME
16.Nm atoi
17.Nd convert
18.Tn ASCII
19string to integer
20.Sh SYNOPSIS
21.Fd #include <stdlib.h>
22.Ft int
23.Fn atoi "const char *nptr"
24.Sh DESCRIPTION
25The
26.Fn atoi
27function converts the initial portion of the string pointed to by
28.Em nptr
29to
30.Em integer
31representation.
32.Pp
33It is equivalent to:
34.Bd -literal -offset indent
35(int)strtol(nptr, (char **)NULL, 10);
36.Ed
37.Sh SEE ALSO
38.Xr atof 3 ,
39.Xr atol 3 ,
40.Xr strtod 3 ,
41.Xr strtol 3 ,
42.Xr strtoul 3
43.Sh STANDARDS
44The
45.Fn atoi
46function conforms to
47.St -ansiC .
48