Use C iswcntrl function to check if a wide character is a control letter

Syntax

C iswcntrl function has the following syntax.

int iswcntrl(wint_t ch)

C iswcntrl function is from header file wctype.h.

Description

wctype.h returns nonzero if ch is a control character or zero is returned.

Example

Use C iswcntrl function to tell if a wide character is a control letter.


#include <stdio.h>
#include <wctype.h>
//  w  w w  .j av a2  s  . c o  m
int main(void)
{
   int wc;

   for (wc=0; wc <= 0xFF; wc++) {
      printf("%3d", wc);
      printf(" %#4x ", wc);
      printf("%2s", iswcntrl(wc)  ? "C"  : " ");


      putchar('\n');
   }
}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h