Share via


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;
}

出力

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

必要条件

ヘッダー: <locale>

名前空間: std