std::toupper (3) - Linux Manuals
std::toupper: std::toupper
NAME
Synopsis
Defined in header <cctype>
int toupper( int ch );
Converts the given character to uppercase according to the character conversion rules defined by the currently installed C locale.
In the default "C" locale, the following lowercase letters abcdefghijklmnopqrstuvwxyz are replaced with respective uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ.
Parameters
ch - character to be converted. If the value of ch is not representable as unsigned char and does not equal EOF, the behavior is undefined.
Return value
Converted character or ch if no uppercase version is defined by the current C locale.
Notes
Like all other functions from <cctype>, the behavior of std::toupper is undefined if the argument's value is neither representable as unsigned char nor equal to EOF. To use these functions safely with plain chars (or signed chars), the argument should first be converted to unsigned char:
Similarly, they should not be directly used with standard algorithms when the iterator's value type is char or signed char. Instead, convert the value to unsigned char first:
Example
// Run this code
Output:
See also
tolower (function)
toupper(std::locale) (function template)
towupper (function)