-mdoc (version 3)
[unix-history] / usr / src / lib / libc / stdlib / atoi.3
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)atoi.3 5.2 (Berkeley) %G%
.\"
.Dd
.Dt ATOI 3
.Os
.Sh NAME
.Nm atoi
.Nd convert
.Tn ASCII
string to integer
.Sh SYNOPSIS
.Fd #include <stdlib.h>
.Ft int
.Fn atoi "const char *nptr"
.Sh DESCRIPTION
The
.Fn atoi
function converts the initial portion of the string pointed to by
.Em nptr
to
.Em integer
representation.
.Pp
It is equivalent to:
.Pp
.Bd -literal -offset indent
(int)strtol(nptr, (char **)NULL, 10);
.Ed
.Sh SEE ALSO
.Xr atof 3 ,
.Xr atol 3 ,
.Xr strtod 3 ,
.Xr strtol 3 ,
.Xr strtoul 3
.Sh STANDARDS
The
.Fn atoi
function conforms to
.St -ansiC .