Name

iswspace - tests for whitespace wide character
defns for definition)

Library

libc.lib

Synopsis

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

Return values

The functions return zero if the character tests false and return non-zero if the character tests true.

Detailed description

The iswspace() function tests whether ’wch’ is a wide-character that introduces white-space.

The following are such characters in the POSIX locale:

SPACE

FORM-FEED

NEWLINE

CARRIAGE-RETURN

TAB

VERTICAL-TAB

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


Examples

#include<wctype.h> //iswspace()
#include<stdio.h> //printf()
int test_iswspace()
{
   int arr[]={’\n’,’0’,’w’,’R’,0x3000,’ ’, 0x000A, 0x002};
   int i = 0;
   int size = 8;
   for( i=0; i<size; i++)
   {
     int ret = iswspace(arr[i]); //call to the API with chars in arr[]
     if( (!ret) != 0 )
     {
        printf("\n%lc is not wide space ", arr[i]);
     }
     else
     {
        printf("\n%lc is wide space", arr[i]);
     }
   }
printf("\n");
}

         

Output

is wide space
0 is not wide space
w is not wide space
R is not wide space
¡¡ is wide space
  is wide space
 is wide space
 is wide space

         

See also

isspace, iswctype

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top