wcsncat(3)

✨ NAME ✨

wcsncat β€” bestie, this one concatenates two wide-character strings πŸ’–


πŸ“š LIBRARY πŸ“š

Standard C library (libc, link it with -lc) 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

wchar_t *wcsncat(size_t n;
                 wchar_t *restrict dest,
                 const wchar_t src[restrict n],
                 size_t n);

πŸ’… DESCRIPTION πŸ’…

okay so. wcsncat() is literally the wide-character equivalent of strncat(3) β€” same energy, just wide chars instead of regular ones ✨

What it does: it copies at most n wide characters from the wide-character string pointed to by src onto the end of the wide-character string pointed to by dest, and then it adds a terminating null wide character (L'\0') so the whole thing is properly closed off. periodt. πŸ’β€β™€οΈ

⚠️ the strings may not overlap. fr fr. not even a little. don't try it.
😭 and here's the part where you (yes, you, the programmer) have to make sure there's room for at least wcslen(dest)+n+1 wide characters sitting at dest. that's on you bestie, the function is not gonna check for you. no cap.

🌈 RETURN VALUE 🌈

wcsncat() returns dest. that's it, that's the tea πŸ“ (it hands you back your destination pointer so you can chain stuff, iconic behavior honestly πŸ‘‘)


πŸ¦‹ ATTRIBUTES πŸ¦‹

For the whole explanation of the terms used in this section, go peek at attributes(7) πŸ“–

Here's the vibe check for wcsncat():

  • Interface: wcsncat()
  • Attribute: Thread safety
  • Value: MT-Safe βœ…

so yeah, it's thread safe, slay πŸ’…


⭐ STANDARDS ⭐

C11, POSIX.1-2008. πŸ’―


🌸 HISTORY 🌸

POSIX.1-2001, C99. it's been around, it's a classic, it ate πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page bestie!! πŸ’– this was pulled straight from the Linux man-pages 6.20, dated 2026-02-08 β€” go forth and concatenate (safely, with room for wcslen(dest)+n+1, i am begging you 😭🫢) βœ¨πŸ¦‹πŸŒΈ

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