isxdigit in c

What is isxdigit in c programming?

isxdigit in c checks the passed character is hexadecimal digit or not.

This function is defined in ctype.h header file.

This function returns non-zero digit if passed character is hexadecimal value otherwise zero.

Prototype

int isxdigit(int a);

Parameter

This function takes character as input parameter and converts it into ASCII value.

Return value

This function returns non-zero value if passed character is hexadecimal value otherwise zero.


Example program for isxdigit function in c

#include<stdio.h>
#include<ctype.h>
int main()
{
  char b='1';
  printf("\n\n\tThe passed value is %d \n\n",isxdigit(b));
  return 0;
}
Example for isxdigit in c programming

Code explanation

isxdigit function is called to check whether the passed character is a hexadecimal digit or not. The result is being copied on to the console.

isxdigit() Man page


Difference between isxdigit and isdigit in c

isxdigit function checks the passed character is hexadecimal or not. isdigit function checks the passed character is a decimal digit or not.

Prototypes are as follows

int isxdigit(int a);

int isdigit(int a);
isxdigit function in cisdigit function in c
Checks the passed character is hexadecimal or not.Checks the passed character is decimal digit or not.
int isxdigit(int a);
int isdigit(int a);

People also ask for

What is isxdigit in c?

isxdigit function checks the passed character is a hexadecimal digit or not. This function is defined in ctype.h header file.