6.23.21 putwchar Function
Writes a wide character to stdout
.
Include
<wchar.h>
Prototype
wint_t putwchar(wchar_t c);
Arguments
c
- the wide character to write
Return Value
The function returns a copy of the wide character written. If a write or encoding error
occurs, WEOF
is returned.
Remarks
The function writes the wide character, c
, to stdout
and at
the position indicated by the file position indicator for the stream (if defined), advancing
the indicator appropriately. The error indicator for stdout
will be set on a
write error. If an encoding error occurs, errno
is set to the value of the
EILSEQ
macro.
Example
#include <wchar.h>
int main(void)
{
wint_t wc;
for(wc = L'0'; iswdigit(wc); wc++)
putwchar(wc);
putwchar(L'\n');
}
Example Output
Content of afile
.
0123456789