Name

iswcntrl - test for control wide character

Library

libc.lib

Synopsis

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

Return values

The functions return non-zero if ’wch’ is a wide control character and returns zero otherwise.

Detailed description

The iswcntrl() function tests whether ’wch’ is a wide control character i.e it belongs to class cntrl(see defns for definition).

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

The control characters are:

BELL

DELETE

BACKSPACE

LINE FEED

VERTICAL TABULATION

FORM FEED

CARRIAGE RETURN...and the like.


Examples

#include<wctype.h> //iswcntrl()
#include<stdio.h> //printf()
int test_iswcntrl()
{
   int arr[]={0x7F,’9’,’A’,’$’,’\a’ };
   int i = 0;
   int size = 5;
   for( i=0; i<size; i++)
   {
     int ret = iswcntrl(arr[i]); //call to API with chars in arr[]
     if( (!ret) != 0 )
     {
        printf("\n%lc is not wide cntrl char ", arr[i]);
     }
     else
     {
        printf("\n%lc is wide cntrl char", arr[i]);
     }
   }
printf("\n");
}


Output

is wide cntrl char
9 is not wide cntrl char
A is not wide cntrl char
$ is not wide cntrl char
 is wide cntrl char


See also

iswctype

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