wchar_t(3type)
β¨ wchar_t β the wide-character type, bestie β¨
okay so real talk, wchar_t is living its main character life in the <pink>Standard C library</pink> (<lavender>libc</lavender>), and we're about to get into it. no cap. π
π SYNOPSIS π
like, here's the whole entrance, verbatim, don't touch it:
#include <stddef.h>
typedef /* ... */ wchar_t;
#include <stdint.h>
#define WCHAR_WIDTH /* ... */
#define WCHAR_MAX /* ... */
#define WCHAR_MIN /* ... */
π¦ DESCRIPTION π¦
so wchar_t is the type you use when you wanna store a wide character. that's it, that's the job. and ngl, it's an integer type β she's a whole number underneath, she just has a fancy wide character reputation. periodt. π
πΈ STANDARDS πΈ
- C11
- POSIX.1-2024
π HISTORY π β the lore, the origin story
wchar_tβ she came in with SUSv1, C99, and POSIX.1-2001. iconic from day one. β¨WCHAR_MAXWCHAR_MINβ these two arrived together in SUSv2, C99, POSIX.1-2001. matching besties fr fr. π«Ά- the
WCHAR_WIDTHmacro is newer btw, she got added in C23 β late to the party but she ate. π₯
β NOTES β
listen, this type is everywhere, she does not gatekeep. these headers also provide this type:
<inttypes.h><stdlib.h><wchar.h><wctype.h>
and this header also provides these macros:
<wchar.h>
π«Ά SEE ALSO π«Ά
go say hi to the neighbors:
vibe check passed π― now you know your wide characters and your width macros, bestie. go forth and be unicode-correct, i'm obsessed with you π§ββοΈ
kisses, this page came to you from Linux man-pages 6.20 π dated 2026-01-09 π it's the wchar_t(3type) era and we're all just living in it π
π
π¦ 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: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms