Export (0) Print
Expand All

toupper

Converts a character to upper case.

template<Class CharType> 
   CharType toupper( 
      CharType _Ch,  
      const locale& _Loc 
   )

_Ch

The character to be converted to upper case.

_Loc

The locale containing the character to be converted.

The character converted to upper case.

The template function returns use_facet<ctype<CharType> >(_Loc).toupper(_Ch).

// locale_toupper.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;

int main( )   
{
   locale loc ( "German_Germany" );
   char result1 = toupper ( 'h', loc );
   cout << "The upper case of 'h' in the locale is: "
        << result1 << "." << endl;
   char result2 = toupper ( 'H', loc );
   cout << "The upper case of 'H' in the locale is: "
        << result2 << "." << endl;
   char result3 = toupper ( '$', loc );
   cout << "The upper case of '$' in the locale is: "
        << result3 << "." << endl;
}

The upper case of 'h' in the locale is: H.
The upper case of 'H' in the locale is: H.
The upper case of '$' in the locale is: $.

Header: <locale>

Namespace: std

Show:
© 2014 Microsoft