Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

isgraph - Test for printable character except space

&pagelevel(4)&pagelevel

Definition

#include <ctype.h>

int isgraph(int c);

isgraph checks whether the character c is a printable character, i.e. an alphanumeric or a
special character. Spaces are considered to be non-printable.
c is the value of the character to be checked.

Return val.

!= 0

0

c is printable and not a space.

c is non-printable or space.

Note

isgraph is implemented both as a macro and as a function (see section“Functions and macros”).

Example

#include <ctype.h>
#include <stdio.h>
int main(void)
{
  int c;
  while((c = getchar()) != EOF)
    printf("%s : %c\n",((isgraph(c))? "Character" : "Cannot print"), c);
  return 0;
} 

See also

isalnum, isascii, iscntrl, isdigit, islower, isalpha, ispunct, isprint, isspace, isupper, isxdigit,
isebcdic, iswgraph