isgraphis

isgraphis(測試字元是否為可列印字元)
相關函式
isprint
表頭檔案
#include <ctype.h>
定義函式
int isgraph (int c)
函式說明
檢查參數c是否為可列印字元,若c所對映的ASCII碼可列印,且非空格字
符則返回TRUE。
返回值
若參數c為可列印字元,則返回TRUE,否則返回NULL(0)。
附加說明
此為宏定義,非真正函式。
範例
/* 判斷str字元串中哪些為可列印字元*/
#include<ctype.h>
main()
{
char str[]="a5 @;";
int i;
for(i=0;str!=0;i++)
if(isgraph(str)) printf("str[%d] is printable character:%
d\n",i,str);
}
執行
str[0] is printable character:a
str[1] is printable character:5
str[3] is printable character:@
str[4] is printable character:;

相關詞條

熱門詞條

聯絡我們