| 1 |
'\" t |
| 2 |
.\" Copyright, Bruno Haible <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
.\" |
| 7 |
.TH wmemcmp 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
wmemcmp \- compare two arrays of wide-characters |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <wchar.h> |
| 16 |
.P |
| 17 |
.BR "int wmemcmp(" "size_t n;" |
| 18 |
.BI " const wchar_t " s1 [ n "], const wchar_t " s2 [ n "], size_t " n ); |
| 19 |
.fi |
| 20 |
.SH DESCRIPTION |
| 21 |
The |
| 22 |
.BR wmemcmp () |
| 23 |
function is the wide-character equivalent of the |
| 24 |
.BR memcmp (3) |
| 25 |
function. |
| 26 |
It compares the |
| 27 |
.I n |
| 28 |
wide-characters starting at |
| 29 |
.I s1 |
| 30 |
and the |
| 31 |
.I n |
| 32 |
wide-characters starting at |
| 33 |
.IR s2 . |
| 34 |
.SH RETURN VALUE |
| 35 |
The |
| 36 |
.BR wmemcmp () |
| 37 |
function returns |
| 38 |
zero if the wide-character arrays of size |
| 39 |
.I n |
| 40 |
at |
| 41 |
.I s1 |
| 42 |
and |
| 43 |
.I s2 |
| 44 |
are equal. |
| 45 |
It returns an integer greater than |
| 46 |
zero if at the first differing position |
| 47 |
.I i |
| 48 |
.RI ( i " <" |
| 49 |
.IR n ), |
| 50 |
the |
| 51 |
corresponding wide-character |
| 52 |
.I s1[i] |
| 53 |
is greater than |
| 54 |
.IR s2[i] . |
| 55 |
It returns an integer less than zero if |
| 56 |
at the first differing position |
| 57 |
.I i |
| 58 |
.RI ( i |
| 59 |
< |
| 60 |
.IR n ), |
| 61 |
the corresponding |
| 62 |
wide-character |
| 63 |
.I s1[i] |
| 64 |
is less than |
| 65 |
.IR s2[i] . |
| 66 |
.SH ATTRIBUTES |
| 67 |
For an explanation of the terms used in this section, see |
| 68 |
.BR attributes (7). |
| 69 |
.TS |
| 70 |
allbox; |
| 71 |
lbx lb lb |
| 72 |
l l l. |
| 73 |
Interface Attribute Value |
| 74 |
T{ |
| 75 |
.na |
| 76 |
.nh |
| 77 |
.BR wmemcmp () |
| 78 |
T} Thread safety MT-Safe |
| 79 |
.TE |
| 80 |
.SH STANDARDS |
| 81 |
C11, POSIX.1-2008. |
| 82 |
.SH HISTORY |
| 83 |
POSIX.1-2001, C99. |
| 84 |
.SH SEE ALSO |
| 85 |
.BR memcmp (3), |
| 86 |
.BR wcscmp (3) |