wcsrchr(3)

πŸ’– wcsrchr(3) β€” bestie's guide to finding the last wide character πŸ’–

okay so like, this is a page from the Library Functions Manual and it's all about wcsrchr, one of those lil wide-character girlies from <wchar.h>. if you've ever been like "where did that character go LAST" β€” this is your moment. periodt.


✨ NAME ✨

wcsrchr β€” search a wide character in a wide-character string πŸ¦‹


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)

like yeah she lives in the main libc, no extra package needed, she's just there for you πŸ’…


🌸 SYNOPSIS 🌸

#include <wchar.h>

wchar_t *wcsrchr(const wchar_t *wcs, wchar_t wc);

πŸŽ€ DESCRIPTION πŸŽ€

okay so wcsrchr() is literally the wide-character equivalent of strrchr(3). same energy, wider characters. 🫢

what it does: it searches for the last occurrence of wc in the wide-character string pointed to by wcs. not the first one. the last one. she's a backwards girly, she's looking from the end, iykyk. ✨


πŸ”₯ RETURN VALUE πŸ”₯

  • if it finds wc, wcsrchr() returns a pointer to the last occurrence of wc in the wide-character string pointed to by wcs πŸ‘‘
  • if wc does not occur in the string, you get NULL. that's it, that's the whole vibe check πŸ’€ no crash, no drama, just NULL.

πŸ’… ATTRIBUTES πŸ’…

for an explanation of the terms used in this section, see attributes(7).

  • Interface: wcsrchr()
  • Attribute: Thread safety
  • Value: MT-Safe

so like, multi-thread safe bestie, go off 🧚


⭐ STANDARDS ⭐

C11, POSIX.1-2008.


🌈 HISTORY 🌈

POSIX.1-2001, C99.

she's been iconic since forever, no cap.


πŸ‘€ SEE ALSO πŸ‘€

  • strrchr(3) β€” the narrow-char sibling, same vibe
  • wcschr(3) β€” same but she finds the first one 🌸

lowkey reminder bestie: wcsrchr finds the last match, wcschr finds the first. don't mix them up, it's giving character-hunting chaos πŸ™ˆ

and that's the whole page!! this little gem comes from Linux man-pages 6.20, dated 2026-02-08, and yes the page itself is literally named wcsrchr(3). go forth and find your last wide character, you absolute main character πŸ’–βœ¨πŸ¦‹

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