xref: /original-bsd/lib/libc/stdlib/atol.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.\"     @(#)atol.3	8.1 (Berkeley) 06/04/93
11.\"
12.Dd
13.Dt ATOL 3
14.Os
15.Sh NAME
16.Nm atol
17.Nd convert
18.Tn ASCII
19string to long integer
20.Sh SYNOPSIS
21.Fd #include <stdlib.h>
22.Ft long
23.Fn atol "const char *nptr"
24.Sh DESCRIPTION
25The
26.Fn atol
27function converts the initial portion of the string pointed to by
28.Ar nptr
29to
30.Em long integer
31representation.
32.Pp
33It is equivalent to:
34.Bd -literal -offset indent
35strtol(nptr, (char **)NULL, 10);
36.Ed
37.Sh SEE ALSO
38.Xr atof 3 ,
39.Xr atoi 3 ,
40.Xr strtod 3 ,
41.Xr strtol 3 ,
42.Xr strtoul 3
43.Sh STANDARDS
44The
45.Fn atol
46function
47conforms to
48.St -ansiC .
49