Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> सी प्रोग्रामिंग

C लाइब्रेरी फंक्शन isgraph()

isgraph() फंक्शन का उपयोग यह जांचने के लिए किया जाता है कि पास किया गया कैरेक्टर का ग्राफिकल प्रतिनिधित्व है या नहीं। यह ctype.h हेडर फाइल में घोषित है।

C भाषा में isgraph() का सिंटैक्स यहाँ है,

int isgraph(int char);

C भाषा में isgraph() का एक उदाहरण यहाँ है,

उदाहरण

#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");
    if(isgraph(c))
        printf("The character has graphical representation\n");
    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\n");
else
    printf("The character isn't having graphical representation\n");
  1. - PHP में ctype_space() फंक्शन

    PHP में ctype_space() फंक्शन जांचता है कि स्ट्रिंग में सभी वर्ण व्हाइटस्पेस वर्ण हैं या नहीं। यदि टेक्स्ट में हर वर्ण किसी प्रकार का व्हाइटस्पेस बनाता है तो TRUE लौटाता है, अन्यथा FALSE। खाली वर्ण के अलावा इसमें टैब, वर्टिकल टैब, लाइन फीड, कैरिज रिटर्न और फॉर्म फीड वर्ण भी शामिल हैं। सिंटैक्स ctype

  1. - PHP में ctype_cntrl() फंक्शन

    PHP में ctype_cntrl() फंक्शन कंट्रोल वर्णों की जांच करता है। यदि वर्तमान लोकेल में टेक्स्ट में हर वर्ण एक कंट्रोल वर्ण है तो TRUE, अन्यथा FALSE लौटाता है। सिंटैक्स ctype_cntrl(str) पैरामीटर्स str - परीक्षण की जाने वाली स्ट्रिंग। रिटर्न वैल्यू यदि वर्तमान लोकेल में टेक्स्ट में हर वर्ण एक कंट्रोल

  1. - PHP में fgetc() फंक्शन

    PHP का fgetc() फंक्शन एक खुली फ़ाइल से एक कैरेक्टर प्राप्त करता है। यह EOF पर false लौटाता है, या file_pointer द्वारा इंगित फ़ाइल से पढ़े गए एकल कैरेक्टर वाली स्ट्रिंग लौटाता है। सिंटैक्स fgetc(file_pointer) पैरामीटर्स file_pointer − फ़ाइल पॉइंटर वैध होना चाहिए, और fopen() या fsockopen() द्वार