xref: /csrg-svn/lib/libc/stdlib/atoi.3 (revision 50284)
148349Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
242105Sbostic.\" All rights reserved.
342105Sbostic.\"
4*50284Sbostic.\" This code is derived from software contributed to Berkeley by
5*50284Sbostic.\" the American National Standards Committee X3, on Information
6*50284Sbostic.\" Processing Systems.
7*50284Sbostic.\"
842105Sbostic.\" %sccs.include.redist.man%
942105Sbostic.\"
10*50284Sbostic.\"     @(#)atoi.3	5.3 (Berkeley) 06/29/91
1142105Sbostic.\"
1248349Scael.Dd
1348349Scael.Dt ATOI 3
1448349Scael.Os
1548349Scael.Sh NAME
1648349Scael.Nm atoi
1748349Scael.Nd convert
1848349Scael.Tn ASCII
1948349Scaelstring to integer
2048349Scael.Sh SYNOPSIS
2148349Scael.Fd #include <stdlib.h>
2248349Scael.Ft int
2348349Scael.Fn atoi "const char *nptr"
2448349Scael.Sh DESCRIPTION
2542105SbosticThe
2648349Scael.Fn atoi
2742105Sbosticfunction converts the initial portion of the string pointed to by
2848349Scael.Em nptr
2942105Sbosticto
3048349Scael.Em integer
3142105Sbosticrepresentation.
3248349Scael.Pp
3342105SbosticIt is equivalent to:
3448349Scael.Pp
3548349Scael.Bd -literal -offset indent
3642105Sbostic(int)strtol(nptr, (char **)NULL, 10);
3748349Scael.Ed
3848349Scael.Sh SEE ALSO
3948349Scael.Xr atof 3 ,
4048349Scael.Xr atol 3 ,
4148349Scael.Xr strtod 3 ,
4248349Scael.Xr strtol 3 ,
4348349Scael.Xr strtoul 3
4448349Scael.Sh STANDARDS
4548349ScaelThe
4648349Scael.Fn atoi
4748349Scaelfunction conforms to
4848349Scael.St -ansiC .
49