wcsncmpのヘルプ・マニュアル
日本語 英語
wcsncmp --help
man wcsncmp
WCSNCMP(3) Linux Programmer’s Manual WCSNCMP(3)
名前
wcsncmp - 2 つの固定長ワイド文字文字列を比較する
書式
#include
int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
説明
wcsncmp() 関数は、 strncmp(3) 関数に対応するワイド文字関数である。この
関数は、s1 が指すワイド文字文字列と s2 が指すワイド文字文字列を比較する
が、最大でも先頭のワイド文字 n 個までしか比較しない。またいずれかの文字
列に L'\0' 文字が現れたら、比較はその位置で終了する。
返り値
wcsncmp() 関数は、s1 と s2 がそれぞれ指す文字列を n 文字に収まるよう に
切り詰めたものが等しければ 0 を返す。この関数は、異なる文字が最初に現わ
れた位置 i (i < n) において、その位置にある文字 s1[i] が s2[i] より大き
ければ正の値を返す。異なる文字が最初に現われた位置 i (i < n) において、
その位置にある文字 s1[i] が s2[i] より小さければ負の値を返す。
準拠
C99.
関連項目
strncmp(3), wcsncasecmp(3)
GNU 1999-07-25 WCSNCMP(3)
WCSNCMP(3) Linux Programmer’s Manual WCSNCMP(3)
NAME
wcsncmp - compare two fixed-size wide-character strings
SYNOPSIS
#include
int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
DESCRIPTION
The wcsncmp() function is the wide-character equivalent of the
strncmp(3) function. It compares the wide-character string pointed to
by s1 and the wide-character string pointed to by s2, but at most n
wide characters from each string. In each string, the comparison
extends only up to the first occurrence of a L'\0' character, if any.
RETURN VALUE
The wcsncmp() function returns zero if the wide-character strings at s1
and s2, truncated to at most length n, are equal. It returns an inte-
ger greater than zero if at the first differing position i (i < n), the
corresponding wide-character s1[i] is greater than s2[i]. It returns
an integer less than zero if at the first differing position i (i < n),
the corresponding wide-character s1[i] is less than s2[i].
CONFORMING TO
C99.
SEE ALSO
strncmp(3), wcsncasecmp(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 1999-07-25 WCSNCMP(3)