wcpcpy(3)

πŸ’– wcpcpy β€” the girlies' guide to wide-char string copying πŸ’–

okay bestie, this is wcpcpy(3), a libc function (from the Standard C library, linked with -lc, iykyk) that copies a wide-character string and β€” this is the fun part β€” hands you back a pointer to where it ended, not where it started. main character energy. periodt. ✨


🌸 NAME 🌸

wcpcpy β€” copy a wide-character string, returning a pointer to its end πŸ¦‹


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) πŸ’…


✨ SYNOPSIS ✨

#include <wchar.h>

wchar_t *wcpcpy(wchar_t *restrict dest, const wchar_t *restrict src);

πŸŽ€ Feature Test Macro Requirements for glibc (see feature_test_macros(7)) πŸŽ€

wcpcpy():

  • Since glibc 2.10:
    • _POSIX_C_SOURCE >= 200809L
  • Before glibc 2.10:
    • _GNU_SOURCE
ngl if you're on old glibc you gotta define _GNU_SOURCE or she simply will not show up for you πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

wcpcpy() is literally the wide-character equivalent of stpcpy(3). it's giving... the same thing but wider. 🫢

she copies the wide-character string pointed to by src β€” including the terminating null wide character (L'\0') β€” into the array pointed to by dest. the whole vibe, terminator and all. πŸ’–

The strings may not overlap. like, they cannot be the same memory, bestie, do not do that.

and the programmer (that's you, babe πŸ’…) must ensure that there is room for at least wcslen(src)+1 wide characters at dest. that +1 is for the null. do not forget the null. the null is the moment. ⭐


πŸ”₯ RETURN VALUE πŸ”₯

wcpcpy() returns a pointer to the end of the wide-character string dest β€” meaning a pointer to the terminating null wide character. so she doesn't give you the beginning, she gives you where it ended. iconic behavior, honestly. πŸ‘‘


πŸ’€ ATTRIBUTES πŸ’€

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

  • wcpcpy() β€” Thread safety: MT-Safe
translated: she is safe to use across threads, no cap. 🌈

πŸ‘‘ STANDARDS πŸ‘‘

POSIX.1-2008. certified slay. πŸŽ€


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, bestie β€” go copy some wide chars responsibly πŸ’–βœ¨

this was Linux man-pages 6.20, dated 2026-02-08, and it's the wcpcpy(3) page 🫢 mwah, study safe πŸŽ€

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