次の方法で共有


locale::classic

静的メンバー関数は従来の C のロケールを表すロケール オブジェクトを返します。

static const locale& classic( );

戻り値

C のロケールへの参照。

解説

従来の C のロケールは国際化プログラムで暗黙的に使用される標準の C ライブラリ内のの.. 米国英語の ASCII のロケールです。

使用例

// locale_classic.cpp
// compile with: /EHsc
#include <iostream>
#include <string>
#include <locale>

using namespace std;

int main( ) 
{
   locale loc1( "german" );
   locale loc2 = locale::global( loc1 );
   cout << "The name of the previous locale is: " << loc2.name( )
        << "." << endl;
   cout << "The name of the current locale is: " << loc1.name( ) 
        << "." << endl;

   if (loc2 == locale::classic( ) )
      cout << "The previous locale was classic." << endl;
   else
      cout << "The previous locale was not classic." << endl;

   if (loc1 == locale::classic( ) )
      cout << "The current locale is classic." << endl;
   else
      cout << "The current locale is not classic." << endl;
}
  
  
  
  

必要条件

ヘッダー: <locale>

名前空間: std

参照

関連項目

locale Class