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