原型:extern int isgraph(int c); 用法:#include 功能:判断字符c是否为除空格外的可打印字符 说明:当c为可打印字符(0x21-0x7e)时,返回非零值,否则返回零。 举例: // isgraph.c #include #include main() { int c; clrscr(); // clear screen c='a'; printf("%c:%s/n",c,isgraph(c)?"yes":"no"); c=' '; // 0x20 printf("%c:%s/n",c,isgraph(c)?"yes":"no"); c=0x7f; printf("%c:%s/n",c,isgraph(c)?"yes":"no"); getchar(); return 0; }
----------------------------
Example
/* isgraph example */ #include #include int main () { FILE * pFile; int c; pFile=fopen ("myfile.txt","r"); if (pFile) { do { c = fgetc (pFile); if (isgraph(c)) putchar (c); } while (c != EOF); fclose (pFile); } }