| 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 |
| 11 | atoi \- convert ASCII string to integer |
| 12 | .SH SYNOPSIS |
| 13 | .nf |
| 14 | .ft B |
| 15 | #include <stdlib.h> |
| 16 | |
| 17 | int |
| 18 | atoi(const char *nptr); |
| 19 | .ft R |
| 20 | .fi |
| 21 | .SH DESCRIPTION |
| 22 | The |
| 23 | .I atoi |
| 24 | function converts the initial portion of the string pointed to by |
| 25 | .I nptr |
| 26 | to |
| 27 | .I integer |
| 28 | representation. |
| 29 | .PP |
| 30 | It is equivalent to: |
| 31 | .sp |
| 32 | .RS |
| 33 | (int)strtol(nptr, (char **)NULL, 10); |
| 34 | .RE |
| 35 | .SH SEE ALSO |
| 36 | atof(3), atol(3), strtod(3), strtol(3), strtoul(3) |
| 37 | .SH STANDARDS |
| 38 | .B Atoi |
| 39 | conforms to ANSI X3.159-1989 (``ANSI C''). |