Name

isgraph

Synopsis

Ascertains whether a given character is graphic

#include <ctype.h>
intisgraph( int c );

The function isgraph() tests whether its character argument is a graphic character; that is, whether the value represents a printing character other than the space character. (In other words, the space character is considered printable, but not graphic.) If the character is graphic, isgraph() returns a nonzero value (that is, true); if not, the function returns 0 (false).

Whether a given character code represents a graphic character depends on the current locale setting for the category LC_CTYPE, which you can query or change using the setlocale() function.

Example

See the example for isprint() in this chapter.

See Also

The corresponding C99 function for wide characters, iswgraph(); isalnum(), isalpha(), isblank(), iscntrl(), isdigit(), islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit(), setlocale()

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.