isxdigit() Test for Hexadecimal Digit
#include <ctype.h>
int isxdigit(c);
int c; Integer value to be tested
isalnum() tests if 'c' is a hexadecimal digit ('A' - 'F', 'a' - 'f',
or '0' -'9').
Returns: True (nonzero) if the integer satisfies the test
condition or false (zero) if it does not. The result is
undefined if 'c' is other than an ASCII character or EOF.
Notes: isxdigit() is a macro.
-------------------------------- Example ---------------------------------
The following statements prompt for a hexadecimal digit and process
only legal hex characters.
#include <ctype.h>
#include <stdio.h>
int ch, x = 0;
char *hdigit;
main()
{
printf("Enter a hexadecimal number: ");
while (ch = getch())
if (isxdigit(ch))
/* process hex number */
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster