iscntrl : iscntrl « ctype.h « C Tutorial






ItemValue
Header filectype.h
Declarationint iscntrl(int ch);
Returnreturns 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;
  }
1

 is a control char
2

 is a control char
3

 is a control char
.








18.4.iscntrl
18.4.1.iscntrl