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 at s1 and s2 are equal ๐Ÿซถ โ€” slay, they matched.
  • at the first differing position i, it returns an integer greater than zero if the corresponding wide-character s1[i] is greater than s2[i]. ๐Ÿ’ช
  • at the first differing position i, it returns an integer less than zero if the corresponding wide-character s1[i] is less than s2[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