std::localeconv
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <clocale>
|
||
| std::lconv* localeconv(); |
||
localeconv函数获取一个指针,指向一个静态对象类型std::lconv,它代表了目前的C语言环境的数字和货币格式规则.Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
(无)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 返回值
Pointer to the current std::lconv object.
[编辑] 注释
通过返回的指针修改的对象引用是未定义的行为.
Original:
Modifying the object references through the returned pointer is undefined behavior.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
std::localeconv修改一个静态对象,把它从不同的线程不同步是不确定的行为.Original:
std::localeconv modifies a static object, calling it from different threads without synchronization is undefined behavior.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 为例
#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 )
[编辑] 另请参阅
| 获取和设置当前的C语言环境 Original: gets and sets the current C locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |
| 格式的详细信息,返回std::localeconv Original: formatting details, returned by std::localeconv The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类) | |
| C documentation for localeconv
| |