isdigit

Character Classification and Conversion Functions

Checks if a character is a decimal digit (characters `0' to `9').

int isdigit( int c );

c The character to check.

For isdigit details, refer to your C language documentation.

Return Values

This function returns a non-zero value (true) if the character is a decimal digit, zero (false) if it is not.

Example

The following example checks if the values of 55 and 109 are digits.

     if (isdigit(55))
          lr_output_message("The value 55 is the digit %c", 55);
     else
          lr_output_message("Value 55 is not a digit. It's the character %c.", 55);
     if (isdigit(109))
          lr_output_message("The value 109 is the digit %c", 109);
     else
          lr_output_message("Value 109 is not a digit. It's the character %c.", 109);
Example: Output:
Action.c(4): The value 55 is the digit 7
Action.c(11): Value 109 is not a digit. It's the character m.