toupper, _toupper, towupper, _toupper_l, _towupper_l

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Convert character to uppercase.

int toupper(  
   int c   
);  
int _toupper(  
   int c   
);  
int towupper(  
   wint_t c   
);  
int _toupper_l(  
   int c ,  
   _locale_t locale  
);  
int _towupper_l(  
   wint_t c ,  
   _locale_t locale  
);  

Parameters

c
Character to convert.

locale
Locale to use.

Each of these routines converts a copy of c, if possible, and returns the result.

If c is a wide character for which iswlower is nonzero and there is a corresponding wide character for which iswupper is nonzero, towupper returns the corresponding wide character; otherwise, towupper returns c unchanged.

There is no return value reserved to indicate an error.

In order for toupper to give the expected results, __isascii and islower must both return nonzero.

Each of these routines converts a given lowercase letter to an uppercase letter if possible and appropriate. The case conversion of towupper is locale-specific. Only the characters relevant to the current locale are changed in case. The functions without the _l suffix use the currently set locale. The versions of these functions with the _l suffix take the locale as a parameter and use that instead of the currently set locale. For more information, see Locale.

In order for toupper to give the expected results, __isascii and isupper must both return nonzero.

Data Conversion Routines

Generic-Text Routine Mappings

TCHAR.H routine_UNICODE & _MBCS not defined_MBCS defined_UNICODE defined
_totuppertoupper_mbctouppertowupper
_totupper_l_toupper_l_mbctoupper_l_towupper_l
System_CAPS_ICON_note.jpg Note

_toupper_l and _towupper_l have no locale dependence and are not meant to be called directly. They are provided for internal use by _totupper_l.

RoutineRequired header
toupper<ctype.h>
_toupper<ctype.h>
towupper<ctype.h> or <wchar.h>

For additional compatibility information, see Compatibility in the Introduction.

See the example in to Functions.

System::Char::ToUpper

is, isw Routines
to Functions
Locale
Interpretation of Multibyte-Character Sequences

Show: