C library functions -isxdigit()
C Standard Library - <ctype.h>
Description
C Library Functionsint isxdigit(int c)Check whether the passed character is a hexadecimal digit.
int isxdigit(int c)Parameter c is a single character.
Hexadecimal is generally represented by the digits 0 to 9 and the letters A to F (or a~f), where A~F represent 10~15:0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F。
Declaration
Below is the declaration of the isxdigit() function.
int isxdigit(int c);
Parameter
- c-- This is the character to be checked.
Return Value
If c is a hexadecimal digit, the function returns a non-zero integer value; otherwise it returns 0.
Example
The following example demonstrates the usage of the isxdigit() function.
Example
Let us compile and run the above program, this will produce the following result:
5 传入到 isxdigit() 函数结果为: 1 M 传入到 isxdigit() 函数结果为: 0
Find the characters in the string that are hexadecimal digits:
Example
Let us compile and run the above program, this will produce the following result:
1 是一个十六进制数 2 是一个十六进制数 3 是一个十六进制数 c 是一个十六进制数 b 是一个十六进制数 e 是一个十六进制数other extensions