| Defined in header <wchar.h> | ||
|---|---|---|
| wint_t putwchar( wchar_t ch ); | (since C95) | 
Writes a wide character ch to stdout.
| ch | - | wide character to be written | 
ch on success, WEOF on failure.
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
 
int main()
{
    setlocale(LC_ALL, "en_US.utf8");
 
    const wchar_t data[] =
    {
        L'\u2200', // Unicode name: "FOR ALL"
        L'∀',
        L'\n',
    };
 
    for (size_t t = 0; t != (sizeof data / sizeof(wchar_t)); ++t)
    {
        if (putwchar(data[t]) == WEOF)
        {
            puts("I/O error in putwchar");
            return EXIT_FAILURE;
        }
    }
 
    return EXIT_SUCCESS;
}Possible output:
∀∀
| writes a character to stdout(function) | |
| (C95) | writes a wide character to a file stream (function) | 
| C++ documentation for putwchar | |
    © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
    https://en.cppreference.com/w/c/io/putwchar