strcmpのヘルプ・マニュアル
日本語 英語
strcmp --help
man strcmp
STRCMP(3) Linux Programmer’s Manual STRCMP(3)
名前
strcmp, strncmp - 二つの文字列を比べる
書式
#include
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
説明
strcmp() 関数は二つの文字列 s1 と s2 を較べる。この関数は、 s1 が s2 に
較べて 1)小さい、2)等しい、3)大きい場合に、ゼロよりも 1)小さい、2)等 し
い、3)大きい整数を返す。
strncmp() 関 数は、s1 と s2 の最初の n 文字だけを比較することを除けば
、strcmp()と同様である。
返り値
strcmp() 関数と strncmp() 関数は整数を返す。この整数は、ゼロよりも 、1)
小 さい、2)等しい、3)大きいのいずれかである。それぞれは、s1(または、こ
の文字列の最初の n バイト)が s2 よりも、1)小さい、2)等しい、3)大きいに
対応している。
準拠
SVr4, 4.3BSD, C89, C99.
関連項目
bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strncasecmp(3),
wcscmp(3), wcsncmp(3)
1993-04-11 STRCMP(3)
STRCMP(3) Linux Programmer’s Manual STRCMP(3)
NAME
strcmp, strncmp - compare two strings
SYNOPSIS
#include
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
DESCRIPTION
The strcmp() function compares the two strings s1 and s2. It returns
an integer less than, equal to, or greater than zero if s1 is found,
respectively, to be less than, to match, or be greater than s2.
The strncmp() function is similar, except it only compares the first
(at most) n characters of s1 and s2.
RETURN VALUE
The strcmp() and strncmp() functions return an integer less than, equal
to, or greater than zero if s1 (or the first n bytes thereof) is found,
respectively, to be less than, to match, or be greater than s2.
CONFORMING TO
SVr4, 4.3BSD, C89, C99.
SEE ALSO
bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strncasecmp(3), strver-
scmp(3), wcscmp(3), wcsncmp(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/.
2009-04-21 STRCMP(3)