কম্পিউটার টিউটোরিয়াল

সি-এ isgraph() লাইব্রেরি ফাংশন


isgraph() ফাংশন ব্যবহার করে চেক করা যায় যে পাস করা ক্যারেক্টারের গ্রাফিক্যাল রিপ্রেজেন্টেশন আছে কিনা। এটি ctype.h হেডার ফাইলে ডিক্লেয়ারড।

সি ভাষায় isgraph()-এর সিনট্যাক্স:

int isgraph(int char);

সি ভাষায় 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_xdigit() ফাংশন

  2. PHP-এ ctype_space() ফাংশন

  3. PHP-এ ctype_cntrl() ফাংশন

  4. PHP-তে fgetc() ফাংশন