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 For an explanation of the terms used in this section, see
31 attributes(7).
32
33 ┌──────────┬───────────────┬─────────┐
34 │Interface │ Attribute │ Value │
35 ├──────────┼───────────────┼─────────┤
36 │wcsncmp() │ Thread safety │ MT-Safe │
37 └──────────┴───────────────┴─────────┘
39 POSIX.1-2001, POSIX.1-2008, C99.
40
42 strncmp(3), wcsncasecmp(3)
43
45 This page is part of release 5.07 of the Linux man-pages project. A
46 description of the project, information about reporting bugs, and the
47 latest version of this page, can be found at
48 https://www.kernel.org/doc/man-pages/.
49
50
51
52GNU 2019-03-06 WCSNCMP(3)