📅  最后修改于: 2020-09-25 10:18:29             🧑  作者: Mango
wscanf() 函数在
int wscanf( const char* format, ... );
wscanf() 函数从stdin读取数据并将值存储到相应的变量中。
#include
#include
#include
#include
using namespace std;
int main()
{
wchar_t hebrew_str[] = L"\u05D0 \u05D1 \u05E1 \u05D3 \u05EA";
wchar_t ch;
setlocale(LC_ALL, "en_US.UTF-8");
wprintf(L"Enter a wide character: ");
wscanf(L"%lc",&ch);
if (iswalnum(ch))
wcout << ch << L" is alphanumeric." << endl;
else
wcout << ch << L" is not alphanumeric." << endl;
return 0;
}
运行该程序时,可能的输出为:
Enter a wide character: ∭
∭ is not alphanumeric.