Skip to content

IS_LOWERCASE macro

Douglas Lyman edited this page Nov 28, 2022 · 3 revisions

Checks if a character is a lowercase character.

Syntax

#define IS_LOWERCASE(c) IN_RANGE(c, 'a', 'z')
BOOL IS_LOWERCASE(char | wchar_t c);

Parameters

c
A char or wchar_t character.

Returns

A BOOL that determines whether the character is lowercase or not.

Remarks

This macro only compares single characters and not entire strings. Passing a pointer to a string will not work.

Example

#include "Definitions.h"

int main() {
    IS_LOWERCASE('a'); // Resolves to true.
    IS_LOWERCASE(L'a'); // Resolves to true.
    IS_LOWERCASE('A'); // Resolves to false.
    IS_LOWERCASE('2'); // Non letter, always resolves to false.
    IS_LOWERCASE("abc"); // Error: Cannot compare entire string.
}

Requirements

Header Definitions.h
Assembly None