1WCSNCMP(3) Linux Programmer's Manual WCSNCMP(3)
2
3
4
6 wcsncmp - compare two fixed-size wide-character strings
7
9 #include <wchar.h>
10
11 int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
12
14 The wcsncmp() function is the wide-character equivalent of the
15 strncmp(3) function. It compares the wide-character string pointed to
16 by s1 and the wide-character string pointed to by s2, but at most n
17 wide characters from each string. In each string, the comparison
18 extends only up to the first occurrence of a null wide character
19 (L'\0'), if any.
20
22 The wcsncmp() function returns zero if the wide-character strings at s1
23 and s2, truncated to at most length n, are equal. It returns an inte‐
24 ger greater than zero if at the first differing position i (i < n), the
25 corresponding wide-character s1[i] is greater than s2[i]. It returns
26 an integer less than zero if at the first differing position i (i < n),
27 the corresponding wide-character s1[i] is less than s2[i].
28
30 C99.
31
33 strncmp(3), wcsncasecmp(3)
34
36 This page is part of release 3.53 of the Linux man-pages project. A
37 description of the project, and information about reporting bugs, can
38 be found at http://www.kernel.org/doc/man-pages/.
39
40
41
42GNU 2011-09-28 WCSNCMP(3)