This topic has not yet been rated - Rate this topic

locale::name

Returns the stored locale name.

string name( ) const;

A string giving the name of the locale.

// 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;
}
The name of the previous locale is: C. The name of the current locale is: German_Germany.1252.

Header: <locale>

Namespace: std

Reference

Other Resources

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.