clocale header file in C++ Last Updated : 12 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report clocale: This header file contains declaration of a set of functions and a type for internationalization support tasks. It supports date format or country specific currency symbols. For example, date/time formatting, monetary formatting and many more. Methods in clocale header: localeconv(): This function returns an object which represents numeric and monetary formatting rules of the current C locale. Its corresponding header file is . The "c" locale is the minimal locale. It is a locale which has the same settings across all the compilers, so the result is predictable anyway. By default used on all C programs. Prototype lconv* localeconv(); Parameters: This method has no parameters. Return value: This function returns a pointer to a static object that contains numeric and monetary formatting rules of the current C locale. Program: CPP #include <iostream> #include <locale.h> using namespace std; int main() { setlocale(LC_MONETARY, "en_US.utf8"); struct lconv* lc = localeconv(); printf("%s ", lc->currency_symbol); return 0; } Output: $ setlocale(): The setlocale() function installs the specified system locale. Moreover, it sets the locale information for the current C program. It can also be used to query the current C locale. It has some parameters namely, LC_ALL -> Selects all the C locale LC_NUMERIC -> Selects numeric formatting category LC_MONETARY -> Monetary formatting category LC_CTYPE -> Character classification category LC_TIME -> Time formatting category Prototype: int setlocale(int category, const char* locale); Return value: It returns a pointer to the string identifying the C locale after applying the changes. Otherwise, it returns a NULL pointer. Program: CPP #include <clocale> #include <iostream> using namespace std; int main() { char* s; setlocale(LC_ALL, "en_UA.utf8"); s = setlocale(LC_ALL, NULL); cout << s << "\n"; return 0; } Output: C Comment More infoAdvertise with us Next Article clocale header file in C++ A aishwarya.27 Follow Improve Article Tags : Misc C++ CPP-Library Practice Tags : CPPMisc Similar Reads Header Files in C++ C++ offers its users a variety of functions, one of which is included in header files. In C++, all the header files may or may not end with the ".h" extension unlike in C, Where all the header files must necessarily end with the ".h" extension. Header files in C++ are basically used to declare an in 6 min read File Handling through C++ Classes In C++, programs run in the computerâs RAM (Random Access Memory), in which the data used by a program only exists while the program is running. Once the program terminates, all the data is automatically deleted. File handling allows us to manipulate files in the secondary memory of the computer (li 8 min read C++23 <print> Header C++ has long been a powerful language, known for its versatility and performance. With each new standard release, the language evolves, introducing features that enhance developer productivity and code readability. One of these additions of the C++ 23 standard is the introduction of <print> he 3 min read How to write your own header file in C? As we all know that files with .h extension are called header files in C. These header files generally contain function declarations which we can be used in our main C program, like for e.g. there is need to include stdio.h in our C program to use function printf() in the program. So the question ar 4 min read Use of "stdafx.h" header in C++ with examples A header file contains the set of predefined standard library functions. The header file can be included in the program with the C preprocessing directive "#include". All the header files have ".h" extension. Syntax: #include <header_file> / "header_file" Here, #: A preprocessor directiveheade 2 min read Like