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

Go to the source code of this file.

Functions

int ispunct (int c)
 Checks if the given character is a punctuation character. More...
 

Function Documentation

◆ ispunct()

int ispunct ( int  ch)

Checks if the given character is a punctuation character.

Checks if the given character is a punctuation character using the default local. The following characters are classified as punctuation character:

  • (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~)

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 punctuation character, zero otherwise.

Definition at line 5 of file ispunct.c.

6 {
7  return isgraph(c) && !isalnum(c);
8 }
int isgraph(int ch)
Checks if the given character has a graphical representation.
Definition: isgraph.c:5
int isalnum(int ch)
Checks if the given character is an alphanumeric character.
Definition: isalnum.c:5

References isalnum(), and isgraph().