Content deleted Content added
m recategorizing headers for C++ project |
→Example: Rewritten to be more appropriate to the subject in C from C++, make use of the unnecessary stdlib.h include, and setlocale() so the currency symbol is shown portably. |
||
Line 13:
===Example===
<source lang="cpp">
#include <
#include <
#include <
int
main(void)
{
/* From setlocale(3):
lconv* currentlocale = localeconv();▼
** On startup of the main program, the portable "C""" locale
std::cout<<"In the current locale, the default currency symbol is: " << currentlocale->currency_symbol << std::endl;▼
** is selected as default. A program may be made portable to
return 0;▼
** all locales by calling setlocale(LC_ALL, """""") ... */
setlocale(LC_ALL, """""");
▲ const struct lconv * const currentlocale = localeconv();
printf
(
▲
currentlocale->currency_symbol
);
}
</source>
==References==
#[http://www.opengroup.org/onlinepubs/009695399/basedefs/locale.h.html locale.h] by [[OpenGroup]]
|