Name

isgraph - character classification routines

Library

libc.lib

Synopsis

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

Return values

The isgraph function returns non-zero if ’c’ has a visible representation and zero otherwise.


Detailed description

The isgraph function returns non-zero if ’c’ has visible representation i.e. it belongs to class graph(see defns for definition). It does not consider characters classified under class space and class cntrl (see defns for definition). For single character representations, the value of the argument is representable as an unsigned char or the value of EOF.

The functionality of this API is independent of the program’s current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class graph, irrespective of the locale they belong to.


Examples

#include<ctype.h> //isgraph()
#include<stdio.h> //printf()
int test_isgraph()
{
   int arr[]={’n’,’\f’, ’6’, ’ ’};
   int i = 0;
   int size = 4;
   for( i=0; i<size; i++)
   {
     int ret = isgraph(arr[i]); //call to API with chars in arr[]
     if( (!ret) != 0 )
     {
        printf("\n%c is not visible char ", arr[i]);
     }
     else
     {
        printf("\n%c is visible char", arr[i]);
     }
   }
printf("\n");
}


Output

n is  visible char
is not visible char
6 is visible char
 is not visible char


See also

iswgraph

Feedback

For additional information or queries on this page send feedback

© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.

Top