C Standard Libraries C++

fputwc()

Declaration

wint_t fputwc(wchar_t wChar, FILE* qpStream);

Description

This function writes a single wide-character, "wChar," to the stream, "qpStream," at the position of the file pointer and advances the pointer. If the write was successful, the character that was written is returned. Otherwise, the function returns WEOF.

Example

#include <cwchar>

int main()
{
    wchar_t waName[] = L"XoaX.net\n";

    int i = 0;
    while (waName[i] != 0) {
        // Put a char into the stdout and check for an error.
        if (fputwc(waName[i], stdout) == WEOF) {
            return 1;
        }
        ++i;
    }
    return 0;
}

Output

fputwc() Output
 

© 2007–2022 XoaX.net LLC. All rights reserved.