检查参数c是否为可打印字符,如果参数c所对应的ASCII字符可打印,且非空白字符则返回ture
#include <stdio.h> #include <ctype.h> int main(void) { char str[] = "abc 123 !@#"; int i = 0; for(i;i<sizeof(str) - 1;i++) { if(isgraph(str[i])){ printf("%c is graph \n",str[i]); } } return 0; }
检查参数c是否为可打印字符,如果参数c所对应的ASCII字符可打印,且非空白字符则返回ture
#include <stdio.h> #include <ctype.h> int main(void) { char str[] = "abc 123 !@#"; int i = 0; for(i;i<sizeof(str) - 1;i++) { if(isgraph(str[i])){ printf("%c is graph \n",str[i]); } } return 0; }