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