isgraph() in C Program

0

isgraph() is a function in the C standard library that checks if a given character is a printable character (excluding the space character) and is not a control character. The function takes a single argument, which is the character to be checked. The function returns a non-zero value (typically 1) if the character is a printable character, and 0 if it is not. The function takes a single argument, which is the character to be checked. For example, the following code checks if the character 'A' is a printable character:


This will output: "The character 'A' is printable."


The isgraph() function checks whether a character is a graphic character, which is a character that has a graphical representation and can be printed on the screen. The function takes a single argument, which is the character to be checked, and returns a non-zero value if the character is a graphic character, and 0 if it is not.


In ASCII environments, graphic characters are in the range of 0x21 through 0x7E. This includes all alphanumeric characters, punctuation marks, and other symbols.


It should be noted that isgraph() is not a wide-character function and it only checks for single-byte characters. For wide characters, the iswgraph() function should be used.

Tags

Post a Comment

0Comments
Post a Comment (0)