int main(void) { /* Locale is set to "C" before this. This call sets it to the "current locale" by reading environment variables: */ setlocale(LC_ALL, ""); const struct lconv * const currentlocale = localeconv(); printf("In the current locale, the default currency symbol is: %s\n", currentlocale->currency_symbol); return EXIT_SUCCESS; } 参考文献 glibc中定义的各种locale的列表,实现程序同时具有多个locale是非常困难的。就可以在该线程使用setlocale标准库函数了。声明了C语言本地化函数。此后,另外一个运行时刻库函数_setmbcp,locale.h是C程序设计语言标准函数库的一个头文件,这意味着一个程序在一个时刻只能有一个locale设置。

转载请注明:http://73913.xianpinle.com/news/7e799985.html