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