C ctype isgraph() Function
Example
Check if a character has a graphical representation:
char c = '#';
if (isgraph(c)) {
printf("%c has a graphical representation", c);
} else {
printf("%c does not have a graphical representation", c);
}
Try it Yourself »
Definition and Usage
The isgraph()
function returns a non-zero value (equivalent to boolean true) if
a character is a graphical representation.
Examples of graphical characters are: ! " # $ % & ' ( ) * etc.
The isgraph()
function is defined in the <ctype.h>
header file.
Syntax
int isgraph(int c);
Parameter Values
Parameter | Description |
---|---|
c | Required. The ASCII value of a character or an actual character |
Technical Details
Returns: | An int value which is non-zero (equivalent to boolean true) if the character has a graphical representation.Otherwise it returns 0 (equivalent to boolean false). |
---|