#include <wchar.h>
The getwchar() function is equivalent to getwc(stdin).
Refer to fgetwc(3C).
If the wint_t value returned by getwchar() is stored into a variable of type wchar_t and then compared against the wint_t macro WEOF, the comparison may never succeed because wchar_t is defined as unsigned.
See attributes(5) for descriptions of the following attributes:
fgetwc(3C), getwc(3C), attributes(5)