C Tutorial/ctype.h/iscntrl
iscntrl
Item Value Header file ctype.h Declaration int iscntrl(int ch); Return returns nonzero if ch is a control character or zero is returned.
#include <ctype.h>
#include <stdio.h>
int main(void)
{
char ch;
for(;;) {
ch = getchar( );
if(ch == ".") {
break;
}
if(iscntrl(ch)){
printf("%c is a control char\n", ch);
}
}
return 0;
}