Name

iswprint - tests for printing wide character

Library

libc.lib

Synopsis

  #include <wctype.h>
  int iswprint (wint_t wch);

Return values

The function returns non-zero if the wide character is printable and returns zero otherwise.

Detailed description

The iswprint() function tests whether ’wch’ is a wide-character that can be printed i.e it belongs to class print(see defns for definition).

Characters used for representing the alphabets, digits, punctuation characters,space are classified as printable. No characters under class cntrl are printable.

The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.

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 print, irrespective of the locale they belong to.


Examples

#include<wctype.h> //iswprint()
#include<stdio.h> //printf()
int test_iswprint()
{
   int arr[]={’n’,’, 0xe1, ’6’, ’ ’};
   int i = 0;
   int size = 5;
   for( i=0; i<size; i++)
   {
     int ret = iswprint(arr[i]); //call to the API with chars in the arr[]
     if( (!ret) != 0 )
     {
        printf("\n%lc is not wide printable char ", arr[i]);
     }
     else
     {
        printf("\n%lc is wide printable char", arr[i]);
     }
   }
printf("\n");
}

            

Output


n is wide printable char
 is not wide printable char
«¡ is wide printable char
6 is wide printable char
  is wide printable char

            

See also

isprint, iswctype

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top