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)
Header
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.