C isxdigit()

The isxdigit() function returns nonzero if ch is a hexadecimal digit; otherwise zero is returned. A hexadecimal digit will be in one of these ranges: A-F, a-f, or 0-9.

isxdigit() Syntax

Following is the syntax of the isxdigit() function :

int isxdigit(int ch);

isxdigit() Example

Following program checks each character read from stdin and reports all hexadecimal digits :

void main()
	char ch;
	for(; ;)
		ch = getchar();
		if(ch == '.')
			printf("%c is hexadecimal digit\n", ch);

C Online Test

« Previous Chapter Next Function »

Like/Share Us on Facebook 😋