iscntrl
raw OCR
Character classification macro.
Defined in header <ctype.h>
Syntax
#include <ctype.h>
int iscntrl(int c);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ | ■ |
Remarks
iscntrl is a macro that classifies ASCII-coded integer values by table lookup. It is a predicate returning nonzero for true and 0 for false. It is defined only when isascii(c) is true or c is EOF.
You can make this macro available as a function by undefining (#undef) it.
Return value
iscntrl returns nonzero if c is a delete character or ordinary control character (0x7F or 0x00 to 0x1 F).
Example
#include <ctype.h>
#include <stdio.h>
int main(void)
{
char c = 'C ;
if (iscntrl(c))
printf("%c is a control character\n",c) ;
else
printf("%c isn't a control character\n",c) ;
return 0;
}
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/ctype.h/iscntrl/
· short form /3.1/iscntrl/