1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\" Modified Mon Mar 29 22:39:41 1993, David Metcalfe
29 .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu)
30 .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers
32 .\" Translated into german by Markus Schmitt (fw@math.uni-sb.de)
33 .\" Modified Sat, 10 Feb 2001, Michael Piefel <piefel@debian.org>
35 .TH ATOI 3 "17. Dezember 2000" "GNU" "Bibliotheksfunktionen"
38 atoi, atol, atoll, atoq \- konvertiert einen String in eine Integerzahl
41 .B #include <stdlib.h>
43 .BI "int atoi(const char *" nptr );
45 .BI "long atol(const char *" nptr );
47 .BI "long long atoll(const char *" nptr );
49 .BI "long long atoq(const char *" nptr );
52 Die \fBatoi()\fP-Funktion konvertiert eine Zeichenkette in eine Integerzahl.
55 ein Zeiger auf den String, der konvertiert werden soll.
56 Der übergebene String wird dabei nach den ersten passenden Zeichen
57 durchsucht und diese werden konvertiert.
58 Die Funktion verhält sich genauso wie:
61 .BI "strtol(" nptr ", (char **)NULL, 10);"
68 Die \fBatol()\fP- und \fBatoll()\fP-Funktionen haben das gleiche Verhalten wie
69 \fBatoi()\fR, nur dass sie den Anfang der Zeichenkette in ihren Rückgabewert
70 (also \fIlong\fP oder \fIlong long\fP) konvertieren. \fBatoq()\fP ist ein
71 veralteter Name für \fBatoll()\fP.
73 Der konvertierte Wert.
75 SVID 3, POSIX.1, BSD 4.3, ISO/IEC 9899. ISO/IEC 9899:1990 (C89) and
76 POSIX.1 (Ausgabe 1996) haben nur die Funktionen \fBatoi()\fP und
77 \fBatol()\fP; C99 fügt die Funktion \fBatoll()\fP hinzu.
79 Die Nicht-Standard-Funktion \fBatoq()\fP ist in libc 4.6.27 oder glibc 2 nicht
80 vorhanden, dafür aber in libc5 und libc 4.7 (wenn auch bis libc 5.4.44 nur als
81 Inline-Funktion in \fB<stdlib.h>\fP). Die \fBatoll()\fP-Funktion ist in glibc 2
82 seit Version 2.0.2 vorhanden, aber nicht in libc4 oder libc5.