atoqのヘルプ・マニュアル
日本語 英語
atoq --help
man atoq
ATOI(3) Linux Programmer’s Manual ATOI(3)
名前
atoi, atol, atoll, atoq - 文字列を整数型に変換する
書式
#include
int atoi(const char *nptr);
long atol(const char *nptr);
long long atoll(const char *nptr);
long long atoq(const char *nptr);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
atoll(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
_ISOC99_SOURCE; または cc -std=c99
説明
atoi() 関数は、nptr によって指示される文字列のはじめの部分を int 型整数
に変換する。この振る舞いは、 atoi() 関数がエラーを見つけない点以外は、
strtol(nptr, (char **) NULL, 10);
と同じである。
atol() 関数と atoll() 関数は atoi() と同様の振る舞いをするが、文字列の
はじめの部分をそれぞれ long や long long に変換する。 atoq() は atoll()
の古い名前である。
返り値
変換された値。
準拠
SVr4, POSIX.1-2001, 4.3BSD, C99. C89 と POSIX.1-1996 には atoi() と
atol() だけが含まれている。 atoq() は GNU による拡張である。
注意
非標準である atoq() 関数は libc 4.6.27 や glibc 2 には含まれていない が
、 libc5 と libc 4.7 には存在している (ただし libc 5.4.44 までは
のインライン関数のみである)。 atoll() 関数は glibc 2 のバ ー
ジョン 2.0.2 から存在しているが、 libc4 や libc5 には存在しない。
関連項目
atof(3), strtod(3), strtol(3), strtoul(3)
GNU 2007-07-26 ATOI(3)
ATOI(3) Linux Programmer’s Manual ATOI(3)
NAME
atoi, atol, atoll, atoq - convert a string to an integer
SYNOPSIS
#include
int atoi(const char *nptr);
long atol(const char *nptr);
long long atoll(const char *nptr);
long long atoq(const char *nptr);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
atoll(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
_ISOC99_SOURCE; or cc -std=c99
DESCRIPTION
The atoi() function converts the initial portion of the string pointed
to by nptr to int. The behavior is the same as
strtol(nptr, (char **) NULL, 10);
except that atoi() does not detect errors.
The atol() and atoll() functions behave the same as atoi(), except that
they convert the initial portion of the string to their return type of
long or long long. atoq() is an obsolete name for atoll().
RETURN VALUE
The converted value.
CONFORMING TO
SVr4, POSIX.1-2001, 4.3BSD, C99. C89 and POSIX.1-1996 include the
functions atoi() and atol() only. atoq() is a GNU extension.
NOTES
The non-standard atoq() function is not present in libc 4.6.27 or glibc
2, but is present in libc5 and libc 4.7 (though only as an inline func-
tion in until libc 5.4.44). The atoll() function is present
in glibc 2 since version 2.0.2, but not in libc4 or libc5.
SEE ALSO
atof(3), strtod(3), strtol(3), strtoul(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2007-07-26 ATOI(3)