wmemchr(3)

✨ NAME ✨

wmemchr β€” okay so we're searching for a wide character inside a wide-character array πŸ’…

and yeah hi bestie, this one lives in the Library Functions Manual, section 3 (wmemchr(3)), which is where all your C library function girlies hang out 🫢


πŸ“š LIBRARY πŸ“š

Standard C library (libc, link it with -lc) β€” the OGs, the blueprint, no cap πŸ’–


🌸 SYNOPSIS 🌸

#include <wchar.h>

wchar_t *wmemchr(size_t n;
                 const wchar_t s[n], wchar_t c, size_t n);

like that's literally it, that's the whole vibe ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: wmemchr() is the wide-character equivalent of memchr(3). Same energy, wider characters πŸ’«

What it does: it searches the n wide characters starting at s for the first occurrence of the wide character c. That's it. That's the whole plot. She finds your girl c, or she doesn't 🎯


πŸŽ€ RETURN VALUE πŸŽ€

wmemchr() hands you back a pointer to the first occurrence of c among the n wide characters starting at s 🫢

but if c is nowhere in that little lineup? You get NULL. Not found. Girl's not there. 😭


πŸ’… ATTRIBUTES πŸ’…

For an explanation of the terms used in this section, go peek at attributes(7) (she explains everything, iykyk) πŸ“–

  • Interface: wmemchr()
  • Attribute: Thread safety
  • Value: MT-Safe πŸ”₯
translation: multi-threaded? she's safe, bestie. go off πŸ‘‘

⭐ STANDARDS ⭐

C11, POSIX.1-2008. Iconic standardized behaviour, periodt πŸ’–


🌈 HISTORY 🌈

POSIX.1-2001, C99. Yeah she's been around, she's a legacy queen πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

  • memchr(3) β€” the narrow-character sister, same vibe but byte-sized
  • wcschr(3) β€” the string-search cousin, also slaying ✨

and that's the whole page bestie!! πŸ’œ this was brought to you by Linux man-pages 6.20, dated 2026-02-08 β€” mwah, go search some wide chars, you've got this πŸ¦‹πŸŽ€πŸ’…

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