English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

isgraph() C 라이브러리 함수

이 함수isgraph()전달된 문자가 그래픽 표현을 가지고 있는지 확인하는 데 사용됩니다. "ctype.h" 헤더 파일에서 선언됩니다.

이것은isgraph()C 언어의 문법,

int isgraph(int char);

이것은isgraph()C 언어의 예제,

예제

#include<stdio.h>
#include<ctype.h>
int main() {
   int a = '\n';
   int b = ''8';
   int c = 's';
   if(isgraph(a))
   printf("The character has graphical representation\n");
   else
   printf("The character isn’t having graphical representation\n");
   if(isgraph(b))
   printf("The character has graphical representation\n");
   else
   printf("The character isn’t having graphical representation\n");
   if(isgraph(c))
   printf("The character has graphical representation\n");
   else
   printf("The character isn’t having graphical representation\n");
   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\n");
else
printf("The character isn’t having graphical representation\n");