#include <ctype.h> int iscntrl(int c);
iscntrl
tests an integer value c
to determine whether it is a
control character.
iscntrl
returns 0 if the character is not a control character, or a
nonzero value if it is. If the argument is EOF
, 0 is returned.
iscntrl
on a noncharacter argument other than EOF
is undefined. Do not assume that iscntrl
returns either 0 or 1.
Note:
For some EBCDIC characters, neither iscntrl(c)
nor isprint(c)
is true, even though this identity is sometimes used as a definition of
isprint
.
iscntrl
function when using it
in a program that is expected to be portable.
IBM uses the words control character to
designate characters between 0x00
and 0x3f
, as well as
0xff
. This implementation defines iscntrl('\xff')
as false.
iscntrl
is implemented by a macro. iscntrl
tests a character
to see whether it is less than a blank in the EBCDIC collating sequence.
This is true for the EBCDIC equivalents of all ASCII control characters.
#include <ctype.h> #include <stdio.h> main() { char *buf; buf = "Hello World. n This is a test. "; do { if (!iscntrl(*buf)) putchar(*buf); else putchar('*'); buf++; } while (*buf); putchar("n"); }
isspace
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.