📅  最后修改于: 2020-09-25 10:19:08             🧑  作者: Mango
iswalnum() 函数在
int iswalnum(wint_t ch);
iswalnum() 函数检查ch是否为字母数字字符 。以下字符是字母数字:
#include
#include
#include
using namespace std;
int main()
{
setlocale(LC_ALL, "en_US.UTF-8");
wchar_t wc1 = L'\u00b6';
wchar_t wc2 = L'\u00c5';
wcout << L"In the current locale" << endl;
iswalnum(wc1)?wcout << wc1 << " is alphanumeric ":wcout << wc1 << " is not alphanumeric ";
wcout << endl;
iswalnum(wc2)?wcout << wc2 << " is alphanumeric ":wcout << wc2 << " is not alphanumeric ";
return 0;
}
运行该程序时,输出为:
In the current locale
¶ is not alphanumeric
Å is alphanumeric