Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
32d993b1 KB |
2 | .\" All rights reserved. |
3 | .\" | |
043368e6 KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" the American National Standards Committee X3, on Information | |
6 | .\" Processing Systems. | |
7 | .\" | |
32d993b1 KB |
8 | .\" %sccs.include.redist.man% |
9 | .\" | |
043368e6 | 10 | .\" @(#)atol.3 5.3 (Berkeley) %G% |
32d993b1 | 11 | .\" |
ae59e04c CL |
12 | .Dd |
13 | .Dt ATOL 3 | |
14 | .Os | |
15 | .Sh NAME | |
16 | .Nm atol | |
17 | .Nd convert | |
18 | .Tn ASCII | |
19 | string to long integer | |
20 | .Sh SYNOPSIS | |
21 | .Fd #include <stdlib.h> | |
22 | .Ft long | |
23 | .Fn atol "const char *nptr" | |
24 | .Sh DESCRIPTION | |
32d993b1 | 25 | The |
ae59e04c | 26 | .Fn atol |
32d993b1 | 27 | function converts the initial portion of the string pointed to by |
ae59e04c | 28 | .Ar nptr |
32d993b1 | 29 | to |
ae59e04c | 30 | .Em long integer |
32d993b1 | 31 | representation. |
ae59e04c | 32 | .Pp |
32d993b1 | 33 | It is equivalent to: |
ae59e04c | 34 | .Bd -literal -offset indent |
32d993b1 | 35 | strtol(nptr, (char **)NULL, 10); |
ae59e04c CL |
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 | |
44 | The | |
45 | .Fn atol | |
46 | function | |
47 | conforms to | |
48 | .St -ansiC . |