function
<cwchar>

putwchar

wint_t putwchar (wchar_t wc);
Write wide character to stdout
Writes the wide character wc to the standard output (stdout).

It is equivalent to calling putwc with stdout as second argument.

This is the wide character equivalent of putchar (<cstdio>).

Parameters

wc
The wide character to be written.

Return Value

On success, the character written is returned (wc promoted to a value of type wint_t).
The return type is wint_t to accommodate for the special value WEOF, which indicates failure:
If the wide character could not be interpreted as a valid multibyte character, the function returns WEOF and sets errno to EILSEQ.
If a writing error occurs, the function also returns WEOF and the error indicator (ferror) is set.

Example

1
2
3
4
5
6
7
8
9
10
/* putwchar example */
#include <wchar.h>

int main ()
{
  wchar_t wc;
  for (wc = 'A' ; wc <= 'Z' ; ++wc) putwchar (wc);

  return 0;
}


See also