📅  最后修改于: 2020-09-25 10:21:07             🧑  作者: Mango
iswcntrl() 函数在
int iswcntrl(wint_t ch);
iswcntrl() 函数检查ch
是否为控制字符 。默认情况下,从0x00到0x1F的和0x7F的代码字符被认为是控制字符。
#include
#include
using namespace std;
int main()
{
wchar_t ch1 = L'\u000c';// unicode for form feed
wchar_t ch2 = L'\u03a3';// unicode for Σ
cout << hex << showbase << boolalpha << "iswcntrl(" << (wint_t)ch1 << ") returned " << (bool)iswcntrl(ch1) << endl;
cout << hex << showbase << boolalpha << "iswcntrl(" << (wint_t)ch2 << ") returned " << (bool)iswcntrl(ch2) << endl;
return 0;
}
运行该程序时,输出为:
iswcntrl(0xc) returned true
iswcntrl(0x3a3) returned false