wint_t getwchar();
#include <iostream>
#include <cwchar>
int main() {
using namespace std;
wcout << "Type a character and hit enter: ";
wchar_t wChar = getwchar();
if (wChar != WEOF) {
wcout << "Char entered = " << wChar << endl;
} else {
wcout << "Read Error!" << endl;
}
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.