c 判断一个字符是否为字母数字
#include <stdio.h> #include <wctype.h> int main () { int i; wchar_t str[] = L"c3po..."; i=0; while (iswalnum(str[i])){ i++; } wprintf (L"The first %d characters are alphanumeric.\n",i); return 0; }
输出
The first 4 characters are alphanumeric.