1ATOI(3)                    Linux Programmer's Manual                   ATOI(3)
2
3
4

NAME

6       atoi, atol, atoll - convert a string to an integer
7

SYNOPSIS

9       #include <stdlib.h>
10
11       int atoi(const char *nptr);
12       long atol(const char *nptr);
13       long long atoll(const char *nptr);
14
15   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17       atoll():
18           _ISOC99_SOURCE ||
19               || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
20

DESCRIPTION

22       The  atoi() function converts the initial portion of the string pointed
23       to by nptr to int.  The behavior is the same as
24
25           strtol(nptr, NULL, 10);
26
27       except that atoi() does not detect errors.
28
29       The atol() and atoll() functions behave the same as atoi(), except that
30       they  convert the initial portion of the string to their return type of
31       long or long long.
32

RETURN VALUE

34       The converted value.
35

ATTRIBUTES

37       For  an  explanation  of  the  terms  used   in   this   section,   see
38       attributes(7).
39
40       ┌────────────────────────┬───────────────┬────────────────┐
41Interface               Attribute     Value          
42       ├────────────────────────┼───────────────┼────────────────┤
43atoi(), atol(), atoll() │ Thread safety │ MT-Safe locale │
44       └────────────────────────┴───────────────┴────────────────┘

CONFORMING TO

46       POSIX.1-2001,  POSIX.1-2008,  C99,  SVr4, 4.3BSD.  C89 and POSIX.1-1996
47       include the functions atoi() and atol() only.
48

NOTES

50       Linux libc provided atoq() as an obsolete name for atoll();  atoq()  is
51       not provided by glibc.
52

SEE ALSO

54       atof(3), strtod(3), strtol(3), strtoul(3)
55

COLOPHON

57       This  page  is  part of release 5.04 of the Linux man-pages project.  A
58       description of the project, information about reporting bugs,  and  the
59       latest     version     of     this    page,    can    be    found    at
60       https://www.kernel.org/doc/man-pages/.
61
62
63
64GNU                               2016-03-15                           ATOI(3)
Impressum