#include <ctype.h>
int isalnum( int ch );
如果参数是数字或字母字符,函数返回非零值,否则返回零值。
#include <stdio.h> #include <ctype.h> int main() { char c1 = 'A'; char c2 = ' '; printf("isalnum(c1) = %d\n", isalnum(c1)); printf("isalnum(c2) = %d\n", isalnum(c2)); return 0; }
输出结果:
isalnum(c1) = 1 isalnum(c2) = 0