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;
}
要求
标头: <locale>
命名空间: std