toupper

字符转换为大写。

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

参数

  • _Ch
    要转换的字符为大写。

  • _Loc
    包含字符的区域设置进行转换。

返回值

字符转换为大写。

备注

模板函数 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;
}

Output

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: $.

要求

页眉: <区域设置>

命名空间: std