std::to_wstring
来自cppreference.com
< cpp | string | basic string
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <string> 中定义
|
||
std::wstring to_wstring( int value ); |
(1) | (C++11 起) |
std::wstring to_wstring( long value ); |
(2) | (C++11 起) |
std::wstring to_wstring( long long value ); |
(3) | (C++11 起) |
std::wstring to_wstring( unsigned value ); |
(4) | (C++11 起) |
std::wstring to_wstring( unsigned long value ); |
(5) | (C++11 起) |
std::wstring to_wstring( unsigned long long value ); |
(6) | (C++11 起) |
std::wstring to_wstring( float value ); |
(7) | (C++11 起) |
std::wstring to_wstring( double value ); |
(8) | (C++11 起) |
std::wstring to_wstring( long double value ); |
(9) | (C++11 起) |
1)
有符号十进制整数转换成宽字符串相同的内容std::swprintf(buf, sz, L"%d", value)会产生足够大的
buf
.原文:
Converts a signed decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%d", value) would produce for sufficiently large
buf
.2)
有符号十进制整数转换成宽字符串std::swprintf(buf, sz, L"%ld", value)会产生足够大的
buf
相同的内容..原文:
Converts a signed decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%ld", value) would produce for sufficiently large
buf
..3)
有符号十进制整数转换成宽字符串相同的内容std::swprintf(buf, sz, L"%lld", value)会产生足够大的
buf
.原文:
Converts a signed decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%lld", value) would produce for sufficiently large
buf
.4)
std::swprintf(buf, sz, L"%u", value)会产生足够大的
buf
了同样内容的宽字符串转换成一个无符号整数.原文:
Converts an unsigned decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%u", value) would produce for sufficiently large
buf
.5)
std::swprintf(buf, sz, L"%lu", value)会产生足够大的
buf
了同样内容的宽字符串转换成一个无符号整数.原文:
Converts an unsigned decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%lu", value) would produce for sufficiently large
buf
.6)
std::swprintf(buf, sz, L"%llu", value)会产生足够大的
buf
了同样内容的宽字符串转换成一个无符号整数.原文:
Converts an unsigned decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%llu", value) would produce for sufficiently large
buf
.@ 7,8 @std::swprintf(buf, sz, L"%f", value)会产生足够大的
buf
了同样内容的宽字符串转换成一个浮点值.原文:
@7,8@ Converts a floating point value to a wide string with the same content as what std::swprintf(buf, sz, L"%f", value) would produce for sufficiently large
buf
.9)
std::swprintf(buf, sz, L"%Lf", value)会产生足够大的
buf
了同样内容的宽字符串转换浮点值.原文:
Converts a floating point value to a wide string with the same content as what std::swprintf(buf, sz, L"%Lf", value) would produce for sufficiently large
buf
.目录 |
[编辑] 参数
value | - | 一个数值转换
|
[编辑] 返回值
一个宽字符串转换后的值
原文:
a wide string holding the converted value
[编辑] 示例
double f = 23.43; std::wstring f_str = std::to_wstring(f);
[编辑] 另请参阅
(C++11) |
到 string 转换为整数或浮点值 原文: converts an integral or floating point value to string (函数) |