C++ cctype isupper() Function
Example
Check if a character is an uppercase letter:
char c = 'B';
if (isupper(c)) {
cout << c << " is an uppercase letter";
} else {
cout << c << " is not an uppercase letter";
}
Definition and Usage
The isupper() function checks if a character is an uppercase letter, from A to Z.
It returns a non-zero number (true) if it is, and 0 (false) if it is not.
The isupper function is defined in the <cctype> header file.
Tip: Use toupper() to change a letter to uppercase.
Syntax
int isupper(int c);
Parameter Values
| Parameter | Description |
|---|---|
| c | Required. The character to check. |
Technical Details
| Returns: | An int value. Non-zero (true) if the character is an uppercase letter, otherwise 0 (false). |
|---|
Related Pages
Read more about strings in our Strings Tutorial.