赞
踩
在头文件中定义int iswalnum(wint_t ch);(自C95以来)
检查给定的宽字符是否为字母数字字符,即数字(0123456789),大写字母(ABCDEFGHIJKLMNOPQRSTUVWXYZ),小写字母(abcdefghijklmnopqrstuvwxyz)或特定于当前语言环境的任何字母数字字符。
参数
CH-宽字符
返回值
如果宽字符是字母数字字符,则为非零值,否则为零。
例
#include #include #include #include
int main(void){
wchar_t c = L'\u13ad'; // the Cherokee letter HA ('Ꭽ') printf("in the default locale, iswalnum(%#x) = %d\n", c, !!iswalnum(c)); setlocale(LC_ALL, "en_US.utf8"); printf("in Unicode locale, iswalnum(%#x) = %d\n", c, !!iswalnum(c));}
输出:
in the default locale, iswalnum(0x13ad) = 0in Unicode locale, iswalnum(0x13ad) = 1
参考
C11标准(ISO / IEC 9899:2011):7.30.2.1.1 iswalnum函数(p:448)
C99标准(ISO / IEC 9899:1999):7.25.2.1.1 iswalnum函数(p:394)
扩展内容
isalnum检查一个字符是否是字母数字(功能)
| iswalnum的C ++文档 |
ASCII 值 (十六进制)字符iscntrl iswcntrl.isprint iswprint.isspace iswspace.isblank iswblank.isgraph iswgraph.ispunct iswpunct.isalnum iswalnum.isalpha iswalpha.isupper iswupper.islower iswlower.isdigit iswdigit.isxdigit iswxdigit.0 - 80x00-0x08控制码 (NUL, etc.)≠000000000000
90x09tab (\t)≠00≠0≠000000000
10 - 130x0A-0x0D空格 (\n,\v,\f,\r)≠00≠0000000000
14 - 310x0E-0x1F控制码≠000000000000
320x20space0≠0≠0≠000000000
33 - 470x21-0x2F!"#$%&'()*+,-./0≠000≠0≠0000000
48 - 570x30-0x3901234567890≠000≠00≠0000≠0≠0
58 - 640x3a-0x40:;<=>?@0≠000≠0≠0000000
65 - 700x41-0x46ABCDEF0≠000≠00≠0≠0≠000≠0
71 - 900x47-0x5AGHIJKLMNOPQRSTUVWXYZ0≠000≠00≠0≠0≠0000
91 - 960x5B-0x60[]^_` | 0 | ≠0 | 0 | 0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 |
97 -1020x61-0x66abcdef0≠000≠00≠0≠00≠00≠0
103-1220x67-0x7Aghijklmnopqrstuvwxyz0≠000≠00≠0≠00≠000
123-1260x7B-0x7E{|}~0≠000≠0≠0000000
1270x7F退格 (DEL)≠000000000000
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。