my previous version was wrong; this one is right
[unix-history] / usr / src / lib / libc / stdlib / atoi.3
CommitLineData
b479f693
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\" @(#)atoi.3 5.1 (Berkeley) %G%
7.\"
8.TH ATOI 3 ""
9.UC 7
10.SH NAME
11atoi \- convert ASCII string to integer
12.SH SYNOPSIS
13.nf
14.ft B
15#include <stdlib.h>
16
17int
18atoi(const char *nptr);
19.ft R
20.fi
21.SH DESCRIPTION
22The
23.I atoi
24function converts the initial portion of the string pointed to by
25.I nptr
26to
27.I integer
28representation.
29.PP
30It is equivalent to:
31.sp
32.RS
33(int)strtol(nptr, (char **)NULL, 10);
34.RE
35.SH SEE ALSO
36atof(3), atol(3), strtod(3), strtol(3), strtoul(3)
37.SH STANDARDS
38.B Atoi
39conforms to ANSI X3.159-1989 (``ANSI C'').