The following example of the isgraph() function can demonstrates you the working of the isgraph() function :
Code:
#include <stdio.h>
#include <ctype.h>
char ch[] = {'C', 0x09, ' ', 0x7d};
#define SIZE sizeof( ch ) / sizeof( char )
void main()
{
int k;
for( k = 0; k < SIZE; k++ ) {
printf( "Char %c is %sa printable character\n",
ch[k],
( isgraph( ch[k] ) ) ? "" : "not " );
}
}
Output :
Code:
Char C is a printable character
Char is not a printable character
Char is not a printable character
Char } is a printable character
Bookmarks