Export (0) Print
Expand All
Expand Minimize

toupper _toupper, towupper

Convert character to uppercase.

int toupper(
   int c 
);
int _toupper(
   int c 
);
int towupper(
   wint_t c 
);

Parameters

c
Character to convert.

Return Value

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.

Remarks

Each of these routines converts a given lowercase letter to an uppercase letter if possible and appropriate.

In order for tolower 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
_totupper toupper _mbctoupper towupper

Requirements

Routine Required header Compatibility
toupper <stdlib.h> and <ctype.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP
_toupper <ctype.h> Win 98, Win Me, Win NT, Win 2000, Win XP
towupper <ctype.h> or <wchar.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

See the example in to Functions.

See Also

is Routines | to Functions Overview | Run-Time Routines and .NET Framework Equivalents

Show:
© 2014 Microsoft