-
Notifications
You must be signed in to change notification settings - Fork 2
IS_HEX macro
Douglas Lyman edited this page Nov 28, 2022
·
1 revision
Checks if a character is a base-16 digit.
#define IS_HEX(c) (IS_DIGIT(c) || (IN_RANGE(c, 'A', 'F') || IN_RANGE(c, 'a', 'f')))
BOOL IS_HEX(char | wchar_t c);
c
A char
or wchar_t
character.
A BOOL that determines whether the character is a base-16 digit or not.
This macro only compares single characters and not entire strings. Passing a pointer to a string will not work.
#include "Definitions.h"
int main() {
IS_HEX('a'); // Resolves to true.
IS_HEX('D'); // Resolves to true.
IS_HEX(L'6'); // Resolves to true.
IS_HEX('g'); // Non hex digit, always resolves to false.
IS_HEX("A1B2C3"); // Error: Cannot compare entire string.
}
Header | Definitions.h |
---|---|
Assembly | None |
The Project Artemis components: Artemis - Artemis-Loader - Artemis-Installer - Artemis-Extension-Framework
The team behind Project Artemis: Sigma - Monke - Tavreth
Contact us at artemis.singularity@gmail.com or join our Discord server!