Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
iscntrl.c File Reference
#include <ctype.h>
Include dependency graph for iscntrl.c:

Go to the source code of this file.

Functions

int iscntrl (int c)
 Checks if the given character is a control character. More...
 

Function Documentation

◆ iscntrl()

int iscntrl ( int  ch)

Checks if the given character is a control character.

Checks if the given character is a control character. The following are examples of control character:

  • codes (0x00-0x1F) and (0x7F)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a control character, zero otherwise.

Definition at line 5 of file iscntrl.c.

6 {
7  return (unsigned)c < 0x20 || c == 0x7f;
8 }