isupper

Header: <ctype.h>

Checks if the given character is an uppercase character according to the current C locale. In the default “C” locale, isupper returns true only for the uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ).

# Declarations

int isupper( int ch );

# Parameters

# Return value

Non-zero value if the character is an uppercase letter, zero otherwise.

# Example

#include <stdio.h>
#include <ctype.h>
#include <locale.h>
 
int main(void)
{
    unsigned char c = '\xc6'; // letter Æ in ISO-8859-1
    printf("In the default C locale, \\xc6 is %suppercase\n",
           isupper(c) ? "" : "not " );
    setlocale(LC_ALL, "en_GB.iso88591");
    printf("In ISO-8859-1 locale, \\xc6 is %suppercase\n",
           isupper(c) ? "" : "not " );
}

# See also