Get wide character from stdin
Returns the next wide character from the standard input (stdin).
It is equivalent to calling getwc with stdin as argument.
This is the wide character equivalent of getchar (<cstdio>).
On success, the character read is returned (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 sequence of bytes read cannot be interpreted as a valid wide character, the function returns WEOF and sets errno to EILSEQ.
If the position indicator was at the end-of-file, the function returns WEOF and sets the eof indicator (feof) of stream.
If a reading error happens, the function also returns WEOF, but sets its error indicator (ferror) instead.
/* getwchar example */
int main ()
fputws (L"Enter text. Include a dot (.) in a sentence to exit:\n",stdout);
} while (wc != L'.');
A simple typewriter. Every sentence is echoed once ENTER has been pressed until a dot (.) is included in the text.
- Get wide character from stream (function)
- Write wide character to stdout (function)
- Read formatted data from stdin (function)