locale::name

返回存储区域设置的名称。

string name( ) const;

返回值

为区域设置的名称的字符串。

示例

// locale_name.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;
}
  

要求

页眉: <区域设置>

命名空间: std

请参见

参考

locale 类