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

Go to the source code of this file.

Functions

int isdigit (int c)
 Checks if the given character is a numeric character. More...
 

Function Documentation

◆ isdigit()

int isdigit ( int  ch)

Checks if the given character is a numeric character.

Checks if the given character is a numeric character (0123456789).

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

Definition at line 5 of file isdigit.c.

6 {
7  return (unsigned)c - '0' < 10;
8 }

Referenced by atoi(), atol(), atoll(), isalnum(), isxdigit(), strtol(), strtoll(), and strtoul().

Here is the caller graph for this function: