|
|
#include <locale.h>char *setlocale(int type, const char *locale);
The setlocale( ) function allows certain parameters that are sensitive to the geopolitical environment of a program’s execution to be queried or set. If locale is null, setlocale( ) returns a pointer to the current localization string. Otherwise, setlocale( ) attempts to use the string specified by locale to set the locale parameters as specified by type. To specify the standard C locale, use the string "C". To specify the native environment, use the null-string "". Refer to your compiler’s documentation for the localization strings that it supports.
At the time of the call, type must be one of the following macros (defined in <locale.h>):
LC_ALL
LC_COLLATE
LC_CTYPE
LC_MONETARY
LC_NUMERIC
LC_TIME
LC_ALL refers to all localization categories. LC_COLLATE affects the operation of the strcoll( ) function. LC_CTYPE alters the way the character functions work. LC_MONETARY determines the monetary format. LC_NUMERIC changes the decimal-point character for formatted input/output functions. Finally, LC_TIME determines the behavior of the strftime( ) function.
The setlocale( ) function returns a pointer to a string associated with the type parameter.
Related functions are localeconv( ), time( ), strcoll( ), and strftime( ).
|
|