In C, putwchar() writes one wide character to standard output. It belongs to the wide-character tools declared in <wchar.h>.
Use wchar_t for wide characters and prefix wide literals with L, as in L"Hello". The examples below use simple C Programming Tutorial patterns and print wide strings with %ls.
Syntax
The following concrete call shows the argument shape before the formal declaration.
C
putwchar(L'A');
Call
What it does
putwchar(L'A')
Writes one wide character to standard output in a typical call.
Include <wchar.h>. Add only the supporting headers actually used by your program.
Library declaration
wint_t putwchar(wchar_t wc);
Parameters
Parameter
Description
wc
The wide character to write, find, fill, or convert.
Return Value
Return Value
Description
Wide character
The character read, written, pushed back, or converted.
WEOF
End of file or failure.
C Examples
Example 1 — Basic stream operation
This example uses putwchar() to basic stream operation, then exposes the result so you can connect the call with its output.