|
Declaration:
char *setlocale(int category, const char *locale);
Sets or reads location dependent information.
category can be one of the following: LC_ALL Set everything.
LC_COLLATE Affects strcoll and strxfrm functions.
LC_CTYPE Affects all character functions.
LC_MONETARY Affects the monetary information provided by localeconv function.
LC_NUMERIC Affects decimal-point formatting and the information provided by localeconv function.
LC_TIME Affects the strftime function.
A value of "C" for locale sets the locale to the normal C translation environment settings (default). A null value ("") sets the native environment settings. A null pointer (NULL) causes setlocale to return a pointer to the string associated with this category for the current settings (no changes occur). All other values are implementation-specific.
After a successful set, setlocale returns a pointer to a string which represents the previous location setting. On failure it returns NULL.
Example:
#include<locale.h>
#include<stdio.h>
int main(void)
{
char *old_locale;
old_locale=setlocale(LC_ALL,"C");
printf("The preivous setting was %s.\n",old_locale);
return 0;
}
Add by Pancho
You can edit it here
|
|
Adding comments is available only for registered users.
|
Top Scientists to Discuss Global Changes at Arctic Conference in Miami
Hundreds of the world's top scientists and policymakers are expected to attend the State of the Arctic conference at the Miami Hyatt Regency from March 16 - 19, 2010. Speakers will include Arden Bement, director of the National Science Foundation (NSF), Jane Lubchenko, administrator of the National Oceanographic and Atmospheric Administration (NOAA), and Wendy Watson-Wright, assistant director-general of the United Nations Educational, Scientific and Cultural Organization (UNESCO). ...
More at http://www.nsf.gov/news/news_summ.jsp?cntn_id=116467&WT.mc_id=USNSF_51&WT.mc_ev=click
This is an NSF News item.
|
|
PycckaR BepcuR
Articles

Library

Downloads

|