function
<cwctype>

iswgraph

int iswgraph (wint_t c);
Check if wide character has graphical representation
Checks whether c is a wide character with graphical representation.

The characters with graphical representation are all those characters than can be printed (as determined by iswprint) except the espace character (L' ').

This function is the wide-character equivalent of isgraph (<cctype>): If c translates with wctob to a character for which isgraph is true, it is considered a character with graphical representation by this function (except possibly for certain locale-specific printable white-space characters other than L' ').

In C++, a locale-specific template version of this function (isgraph) exists in header <locale> for all character types.

Parameters

c
Wide character to be checked, casted to a wint_t, or WEOF.
wint_t is an integral type.

Return Value

A value different from zero (i.e., true) if indeed c is a character with graphical representation. Zero (i.e., false) otherwise.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* iswgraph example */
#include <stdio.h>
#include <wctype.h>
int main ()
{
  FILE * pFile;
  wint_t c;
  pFile = fopen ("myfile.txt","r");
  if (pFile)
  {
    do {
      c = fgetwc (pFile);
      if (iswgraph(c)) putwchar (c);
    } while (c != WEOF);
    fclose (pFile);
  }
}

This example prints out the contents of "myfile.txt" without spaces and special characters, i.e. only prints out the characters that qualify as iswgraph.

See also