次の方法で共有


ctype::toupper

大文字に文字または文字の範囲を変換します。

CharType toupper(
    CharType ch
) const;
const CharType *toupper(
    CharType* first, 
    const CharType* last
) const;

パラメーター

  • ch
    大文字に変換する文字。

  • first
    大文字と小文字を変換する文字の範囲の最初の文字へのポインター。

  • last
    大文字と小文字を変換する文字の範囲の最後の文字に続く文字へのポインター。

戻り値

一つ目のメンバー関数はパラメーター chの大文字のフォームを返します。大文字のフォームがない場合、chを返します。

2 番目のメンバー関数は lastを返します。

解説

一つ目のメンバー関数は do_toupperch () を返します。2 番目のメンバー関数は do_toupper (first、last) を返します。

使用例

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

int main( )   
{
   locale loc1 ( "German_Germany" );
   
   char string[] = "Hello, my name is John";

   use_facet<ctype<char> > ( loc1 ).toupper
      ( string, string + strlen(string) );
   cout << "The uppercase string is: " << string << endl;
}
  

必要条件

ヘッダー: <locale>

名前空間: std

参照

関連項目

ctype Class