The first version (1) returns the uppercase equivalent of c. If no such equivalent character exists, the value returned is c, unchanged.

The second version (2) replaces any lowercase characters in the range [low,high) with its uppercase equivalent.

Internally, this function simply calls the virtual protected member do_toupper, which does the above by default in both the generic template and the char specialization (ctype<char>).

A non-member function with the same name (toupper) exists with the same behavior as (1).

Parameters

c

Character to convert case.
Member type char_type is the facet's character type (defined as an alias of ctype's template parameter, charT).

low, high

Pointer to the beginning and end of the sequence of characters. The range used is [low,high), which contains all the characters between low and high, including the character pointed by low but not the character pointed by high.
Note that null characters (if any) are also considered, and the function proceeds beyond them, until the entire range is converted.
Member type char_type is the facet's character type (defined as an alias of ctype's template parameter, charT).

Return value

The first version (1) returns the uppercase equivalent of c (or c unchanged if no uppercase equivalent exists).

The second version always returns high.

Member type char_type is the facet's character type (defined as an alias of ctype's template parameter, charT).