Site hosted by Angelfire.com: Build your free website today!

Table of Contents Previous Next


1.6 The Standard Headers: <locale.h>

The <locale.h> library provides object-oriented environment variables.  A locale provides information on related parameters.  Locales have substructure so you can set an entire locale, or alter one or more categories.


struct lconv *localeconv(void);
The localeconv function sets the components of an object with type struct lconv with values appropriate for the formatting of numeric quantities (monetary and otherwise) according to the rules of the current locale.

Returns
The localeconv function returns a pointer to the filled-in object.


char *setlocale(int category, const char *locale);
Selects the appropriate portion of the program's locale as specified by the category and locale arguments.  category can be LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME.  Argument locale can be "C" or "", or other implementation-defined strings.

Returns
A pointer to the string associated with the specified category for the new locale.  If the selection cannot be honoured, a NULL pointer is returned and the program's locale is not changed.


Table of Contents Previous Next

Last modified: Fri Feb 25 13:51:17 2000