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

Go to the source code of this file.

Functions

int isascii (int c)
 Checks if a given character is a 7-bit US-ASCII character. More...
 

Function Documentation

◆ isascii()

int isascii ( int  ch)

Checks if a given character is a 7-bit US-ASCII character.

Checks if a given character 7-bit unsigned char value that fits into the ASCII character set. which is any character between 0 and 0x7f inclusive.

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 ch is a 7-bit US-ASCII character code, zero otherwise.

Definition at line 5 of file isascii.c.

6 {
7  return !(c & ~0x7f);
8 }