Skip to content

IS_UPPERCASE macro

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

Checks if a character is an uppercase character.

Syntax

#define IS_UPPERCASE(c) IN_RANGE(c, 'A', 'Z')
BOOL IS_UPPERCASE(char | wchar_t c);

Parameters

c
A char or wchar_t character.

Returns

A BOOL that determines whether the character is uppercase 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_UPPERCASE('A'); // Resolves to true.
    IS_UPPERCASE(L'A'); // Resolves to true.
    IS_UPPERCASE('a'); // Resolves to false.
    IS_UPPERCASE('2'); // Non letter, always resolves to false.
    IS_UPPERCASE("ABC"); // Error: Cannot compare entire string.
}

Requirements

Header Definitions.h
Assembly None