fputws

Header: <wchar.h>

Writes every character from the null-terminated wide string str to the output stream stream, as if by repeatedly executing fputwc.

# Declarations

int fputws( const wchar_t *str, FILE *stream );

(since C95) (until C99)

int fputws( const wchar_t * restrict str, FILE * restrict stream );

(since C99)

# Parameters

# Return value

On success, returns a non-negative value

# Example

#include <locale.h>
#include <stdio.h>
#include <wchar.h>
 
int main(void)
{
    setlocale(LC_ALL, "en_US.utf8");
    int rc = fputws(L"御休みなさい", stdout);
 
    if (rc == EOF)
       perror("fputws()"); // POSIX requires that errno is set
}

# See also