isgraph() C 庫函式
isgraph() 函式用於檢查傳入的字元是否具有圖形化表示形式。它宣告在“ctype.h”標頭檔案中。
下面是 isgraph() 在 C 語言中的語法:
int isgraph(int char);
下面是 isgraph() 在 C 語言中的示例:
示例
#include<stdio.h>
#include<ctype.h>
int main() {
int a = '
';
int b = '8';
int c = 's';
if(isgraph(a))
printf("The character has graphical representation
");
else
printf("The character isn’t having graphical representation
");
if(isgraph(b))
printf("The character has graphical representation
");
else
printf("The character isn’t having graphical representation");
if(isgraph(c))
printf("The character has graphical representation
");
else
printf("The character isn’t having graphical representation");
return 0;
}輸出
The character isn’t having graphical representation The character has graphical representation The character has graphical representation
在上面的程式中,我們宣告並初始化了三個變數。這些變數檢查它們是否使用 isgraph() 函式進行圖形化表示。
if(isgraph(a))
printf("The character has graphical representation
");
else
printf("The character isn’t having graphical representation
");
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP