Difference between revisions of "cpp/locale/localeconv"
From cppreference.com
(→Example: use {{example template}}) |
m (Update links.) |
||
(3 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
{{cpp/title|localeconv}} | {{cpp/title|localeconv}} | ||
{{cpp/locale/navbar}} | {{cpp/locale/navbar}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{dcl header|clocale}} |
− | {{ | + | {{dcl | |
std::lconv* localeconv(); | std::lconv* localeconv(); | ||
}} | }} | ||
− | {{ | + | {{dcl end}} |
− | The {{tt|localeconv}} function obtains a pointer to a static object of type {{ | + | The {{tt|localeconv}} function obtains a pointer to a static object of type {{lc|std::lconv}}, which represents numeric and monetary formatting rules of the current C locale. |
===Parameters=== | ===Parameters=== | ||
Line 14: | Line 14: | ||
===Return value=== | ===Return value=== | ||
− | Pointer to the current {{ | + | Pointer to the current {{lc|std::lconv}} object. |
===Notes=== | ===Notes=== | ||
Line 22: | Line 22: | ||
===Example=== | ===Example=== | ||
− | {{ | + | {{include| cpp/locale/example1}} |
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/locale/dsc setlocale}} |
− | {{ | + | {{dsc inc | cpp/locale/dsc lconv}} |
− | {{ | + | {{dsc see c | c/locale/localeconv}} |
− | {{ | + | {{dsc end}} |
+ | |||
+ | [[de:cpp/locale/localeconv]] | ||
+ | [[es:cpp/locale/localeconv]] | ||
+ | [[fr:cpp/locale/localeconv]] | ||
+ | [[it:cpp/locale/localeconv]] | ||
+ | [[ja:cpp/locale/localeconv]] | ||
+ | [[pt:cpp/locale/localeconv]] | ||
+ | [[ru:cpp/locale/localeconv]] | ||
+ | [[zh:cpp/locale/localeconv]] |
Latest revision as of 22:09, 31 May 2013
Defined in header <clocale>
|
||
std::lconv* localeconv(); |
||
The localeconv
function obtains a pointer to a static object of type std::lconv, which represents numeric and monetary formatting rules of the current C locale.
Contents |
[edit] Parameters
(none)
[edit] Return value
Pointer to the current std::lconv object.
[edit] Notes
Modifying the object references through the returned pointer is undefined behavior.
std::localeconv
modifies a static object, calling it from different threads without synchronization is undefined behavior.
[edit] Example
Run this code
#include <clocale> #include <iostream> int main() { std::setlocale(LC_ALL, "ja_JP.UTF-8"); std::lconv* lc = std::localeconv(); std::cout << "Japanese currency symbol: " << lc->currency_symbol << '(' << lc->int_curr_symbol << ")\n"; }
Output:
Japanese currency symbol: ¥(JPY )
[edit] See also
gets and sets the current C locale (function) | |
formatting details, returned by std::localeconv (class) | |
C documentation for localeconv
|