iswgraph() in C/C++ with Examples Last Updated : 13 Feb, 2023 Comments Improve Suggest changes Like Article Like Report The iswgraph() is a built-in function in C/C++ which checks if the given wide character has a graphical representation or not. It is defined within the cwctype header file of C++. By default, the following characters are graphic: Digits (0 to 9)Uppercase letters (A to Z)Lowercase letters (a to z)Punctuation characters (!"#$%&'()*+, -./:;?@[\]^_`{|}~) Syntax: int iswgraph(ch) Parameter: The function accepts a single mandatory parameter ch which specifies the wide character which we have to check that if it has a graphical representation or not. Return Value: The function returns two values as shown below. If the ch has a graphical representation character, then a non-zero value is returned.If it is not a graphical representation character, then 0 is returned. Below programs illustrates the above function. Program 1: CPP // C++ program to illustrate // iswgraph() function #include <cwctype> #include <iostream> using namespace std; int main() { wchar_t ch1 = '?'; wchar_t ch2 = ' '; // Function to check if the character // has a graphical representation or not if (iswgraph(ch1)) wcout << ch1 << " has graphical representation "; else wcout << ch1 << " does not have graphical representation "; wcout << endl; if (iswgraph(ch2)) wcout << ch2 << " has graphical representation "; else wcout << ch2 << " does not have graphical representation "; return 0; } Output:? has graphical representation does not have graphical representation Program 2: CPP // C++ program to illustrate // iswgraph() function #include <cwctype> #include <iostream> using namespace std; int main() { wchar_t ch1 = ' '; wchar_t ch2 = '3'; // Function to check if the character // has a graphical representation or not if (iswgraph(ch1)) wcout << ch1 << " has graphical representation "; else wcout << ch1 << " does not have graphical representation "; wcout << endl; if (iswgraph(ch2)) wcout << ch2 << " has graphical representation "; else wcout << ch2 << " does not have graphical representation "; return 0; } Output:does not have graphical representation 3 has graphical representation Comment More infoAdvertise with us Next Article iswgraph() in C/C++ with Examples I IshwarGupta Follow Improve Article Tags : Misc C Language C++ CPP-Functions C-Library +1 More Practice Tags : CPPMisc Similar Reads Trigraphs in C++ with Examples In C++, a trigraph is a three-character sequence that represents a single character. It means that trigraph sequences are the set of three characters starting from double question marks (??). These characters are constructed using a sequence of 3 characters called trigraphs and these set of the char 2 min read Priority Queue of Lists in C++ with Examples Priority Queue Priority queues are a type of container adapters, specifically designed such that the first element of the queue is the greatest of all elements in the queue and elements are in nonincreasing order (hence we can see that each element of the queue has a priority {fixed order}). Functio 5 min read Forward List and List of Pairs in C++ with Examples Forward List Forward list in STL implements singly linked list. Introduced from C++11, forward lists are more useful than other containers in insertion, removal, and moving operations (like sort) and allow time constant insertion and removal of elements. It differs from the list by the fact that the 8 min read Graph Cycle Detection in C++ Detecting cycles in a graph is a crucial problem in graph theory that has various applications in fields like network analysis, databases, compilers, and many others. In this article, we will learn how to detect cycles in a graph in C++. Graph Cycle Detection in C++A cycle in a graph is a path that 7 min read isgraph() C library function The C library function isgraph() checks whether a character is a graphic character or not. Characters that have graphical representation are known are graphic characters. For example: ':' ';' '?' '@' etc. Syntax - #include <ctype.h> int isgraph(int ch); Return Value - function returns nonzero if 2 min read Like