Resets the default local for the program.
static locale global( const locale& _Loc );
The locale to be used as the default locale by the program.
The previous locale before the default locale was reset.
At program startup, the global locale is the same as the classic locale.
// locale_global.cpp // compile with: /EHsc #include <locale> #include <iostream> #include <tchar.h> using namespace std; int main( ) { locale loc ( "German_germany" ); locale loc1; cout << "The initial locale is: " << loc1.name( ) << endl; locale loc2 = locale::global ( loc ); locale loc3; cout << "The current locale is: " << loc3.name( ) << endl; cout << "The previous locale was: " << loc2.name( ) << endl; }
The initial locale is: C The current locale is: German_Germany.1252 The previous locale was: C
Header: <locale>