C examples for wchar.h:getwchar
function
<cwchar> <wchar.h>
Get wide character from stdin
wint_t getwchar (void);
(none)
On success, the character read is returned.
On error, WEOF is returned, which indicates failure.
#include <stdio.h> #include <wchar.h> int main ()/*ww w . j a v a 2 s.co m*/ { wint_t wc; fputws (L"Enter text. Include a dot (.) in a sentence to exit:\n",stdout); do { wc=getwchar(); putwchar (wc); } while (wc != L'.'); return 0; }