[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
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 */
}
See Also:
isalnum()
isalpha()
isascii()
iscntrl()
isdigit()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson