Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

iscntrl - Test for control character

&pagelevel(4)&pagelevel

Definition

#include <ctype.h>

int iscntrl(int c);

iscntrl checks whether the character c from is a control character. Control characters are
non-printable characters (e.g. for printer control). The non-printable characters for white
space are not included (see isspace).

Return val.

!= 0

0

c is a control character.

c is not a control character.

Note

iscntrl is implemented both as a macro and as a function (see section “Functions and macros”).

Example

#include <ctype.h>
#include <stdio.h>
int main(void)
{
  int c;
  while((c = getchar()) != EOF)
     printf("%s : %c\n", ((iscntrl(c)) ? "Control character":"Other"), c);
  return 0;
} 

See also

isalnum, isascii, isalpha, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit,
isebcdic, iswcntrl