C ++ STL中的iswalnum()函数
C++STL中的iswalnum()函数检查给定的宽字符是否为字母数字字符,即数字(0-9),大写字母(AZ),小写字母(az)或任何字母数字字符。
算法
Begin Initializes the characters. Call function iswalnum(c1) to check whether it is alphanumeric or not. If it is alphanumeric character, then value will be returned otherwise zero will be returned. End
范例程式码
#include <cwctype>
#include <iostream>
using namespace std;
int main() {
wchar_t c1 = '/';
wchar_t c2 = 'a';
if (iswalnum(c1))
wcout << c1 << " is alphanumeric ";
else
wcout << c1 << " is not alphanumeric ";
wcout << endl;
if (iswalnum(c2))
wcout << c2 << " is alphanumeric ";
else
wcout << c2 << " is not alphanumeric ";
return 0;
}输出结果
/ is not alphanumeric a is alphanumeric
热门推荐
1 敏字的祝福语简短
10 幼儿老师过年简短祝福语
11 生日祝福语简短而有深意
12 科研文案祝福语简短励志
13 岁岁祝福语简短独特
14 六一简短祝福语有哪些
15 生日祝福语古朴简短独特
16 迎新祝福语简短20字
17 女儿升学宴祝福语简短
18 新年祝福语长辈简短红包