Name
isxdigit
Synopsis
Ascertains whether a given character is a hexadecimal digit
#include <ctype.h> intisxdigit
( intc
);
The function isxdigit()
tests whether its character argument is a hexadecimal digit. The
results depend on the current locale setting for the localization
category LC_CTYPE
, which you can
query or change using the setlocale()
function. In the C
locale, isxdigit()
returns a nonzero value (that
is, true
) if the character is
between '0'
and '9'
inclusive, or between 'A'
and 'F'
inclusive, or between 'a'
and 'f'
inclusive. If not, the function
returns 0 (false
).
Example
See the example for isprint()
in this
chapter.
See Also
The corresponding C99 function for wide characters, iswxdigit()
; isalnum()
, isalpha()
, isblank()
, iscntrl()
, isdigit()
, isgraph()
, islower()
, isprint()
, ispunct()
, isspace()
, isupper()
, isxdigit()
; the
extensible wide-character classification function, iswctype()
Get C in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.