wmemcmp(3)

πŸ’– wmemcmp β€” bestie edition πŸ’–

okay so listen. this is wmemcmp from the wmemcmp(3) manual page, and she is the wide-character glow-up of memcmp(3). no cap. let's get into it πŸ¦‹


✨ NAME ✨

wmemcmp β€” compare two arrays of wide-characters 🌸


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” the classic, the icon, the one that's already on your machine πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

int wmemcmp(size_t n;
            const wchar_t s1[n], const wchar_t s2[n], size_t n);

yes bestie that is literally the whole thing. she's compact. she knows what she is. πŸ‘‘


πŸ’« DESCRIPTION πŸ’«

so wmemcmp() is the wide-character equivalent of the memcmp(3) function β€” like, same energy, but for wide chars instead of plain bytes. 🧚

what she actually does: she compares the n wide-characters starting at s1 against the n wide-characters starting at s2. that's it. that's the job. and she does it well. πŸ”₯


🫢 RETURN VALUE 🫢

here's the vibe check results, and you need to know these:

  • she returns zero if the wide-character arrays of size n at s1 and s2 are equal. happy ending, besties are matching πŸ’š
  • she returns an integer greater than zero if, at the first differing position i (where i < n), the corresponding wide-character s1[i] is greater than s2[i]. so s1[i] > s2[i], she wins, main character energy πŸ‘‘
  • she returns an integer less than zero if, at the first differing position i (where i < n), the corresponding wide-character s1[i] is less than s2[i]. so s1[i] < s2[i], she's giving soft launch 😭
note the i < n in both of those β€” the difference has to actually happen inside your array. that's the whole point. periodt.

🌈 ATTRIBUTES 🌈

for an explanation of the terms used in this section, go peek at attributes(7) β€” she explains the vocabulary, i just deliver the gossip πŸ’–

  • Interface: wmemcmp() β€” Attribute: Thread safety β€” Value: MT-Safe ✨

so yeah. multiple threads can call her at the same time and everything stays cute. MT-Safe, no drama, no data races, we love to see it πŸŽ€


⭐ STANDARDS ⭐

C11, POSIX.1-2008. officially official. certified. πŸ“œ


πŸ•°οΈ HISTORY πŸ•°οΈ

she came through in POSIX.1-2001 and C99. an elder icon who has been serving since the early 2000s πŸ’œ


πŸ‘€ SEE ALSO πŸ‘€

  • memcmp(3) β€” the byte-level original, her inspiration πŸ’«
  • wcscmp(3) β€” the null-terminated cousin, different personality, also iconic πŸ¦‹

🌸 cutie sign-off 🌸

this lil page came from Linux man-pages 6.20, dated 2026-02-08, and it's the wmemcmp(3) entry babes πŸŽ€ go forth, compare your wide-characters, stay MT-Safe, and remember: zero means equal, and equal means slay πŸ’…βœ¨

πŸ“¦ 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