Name

putwc

Synopsis

Writes a wide character to a file

#include <stdio.h>
#include <wchar.h>
wint_tputwc( wchar_t c, FILE *fp );

The function or macro putwc() is similar to the function fputwc(). It writes one character to the current file position of the specified FILE pointer. The return value is the character written, or WEOF if an error occurred.

Because putwc() may be implemented as a macro, it might evaluate its argument more than once. Make sure the argument is not an expression with side effects—or else use fputwc().

Example

See the examples for getwc() and fgetwc() in this chapter.

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.