wcscmp(3)
โจ wcscmp(3) โจ
okay bestie, pull up a chair because today we're getting into wcscmp, straight out of the Library Functions Manual ๐ she lives in the Standard C library (libc, -lc) and she is here to compare wide-character strings. no cap. ๐ฆ
๐ธ NAME ๐ธ
wcscmp โ compare two wide-character strings ๐
๐ LIBRARY ๐
Standard C library (libc, -lc) ๐
๐ SYNOPSIS ๐
#include <wchar.h>
int wcscmp(const wchar_t *s1, const wchar_t *s2);
๐ DESCRIPTION ๐
so, the way that wcscmp() works is basically the wide-character equivalent of strcmp(3). that's the whole vibe. it compares the wide-character string pointed to by s1 and the wide-character string pointed to by s2, and it is obsessed with finding the first spot where they differ. ๐ญโจ
๐ฅ RETURN VALUE ๐ฅ
the results are giving very specific, okurrr:
wcscmp()returns zero if the wide-character strings ats1ands2are equal ๐ซถ โ slay, they matched.- at the first differing position
i, it returns an integer greater than zero if the corresponding wide-characters1[i]is greater thans2[i]. ๐ช - at the first differing position
i, it returns an integer less than zero if the corresponding wide-characters1[i]is less thans2[i]. ๐ฅ
that's it, that's the whole personality. no grey area, just sign. periodt. ๐
๐ ATTRIBUTES ๐
for an explanation of the terms used in this section, go peek at attributes(7) โ she's the reference bestie for all this terminology. ๐ง
- Interface:
wcscmp() - Attribute: Thread safety
- Value:
MT-Safe๐
ngl MT-Safe is iconic behaviour, we love a thread-safe queen. ๐
โญ STANDARDS โญ
C11, POSIX.1-2008. ๐โจ
๐ฆ HISTORY ๐ฆ
POSIX.1-2001, C99. so she's been around, she's got history, she's a legacy main character fr fr. ๐ธ
๐ SEE ALSO ๐
iykyk, go read those next, they're all in the same friend group. ๐
Linux man-pages 6.20 ยท 2026-02-08 ยท wcscmp(3) โ ok that's the whole page bestie, tysm for reading, go compare some wide-character strings responsibly, mwah ๐
๐๐
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms