c++ - 如何在 C++ 中将整数转换为十六进制 wstring

标签 c++ hex

如何在C++中将整数转换为十六进制std::wstring?

最佳答案

与窄字符串相同:

#include <iomanip>
#include <sstream>

//...

std::wostringstream oss;  // note the 'w'
oss << std::hex << n;

return oss.str();         // type is std::wstring

关于c++ - 如何在 C++ 中将整数转换为十六进制 wstring,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7970075/

相关文章:

c++ - 如何编写特征转换以将 'const' 添加到类型*

c - 使用 fread 从 Matlab 读取所有字符到嵌入式设备

c# - 在 C# 中将 double 转换为十六进制

c# - 无法将 32 位十六进制值分配给整数

c++ - 'malloc_stats' 函数中的奇怪行为

c++ - 生命游戏,C++ - 多态数组(也许还有指针)

c++ - 使用反转距离的 K 均值聚类

c++ - 如何删除 QToolButton 上的轮廓

mysql - 如何在 MySQL 中取消十六进制并进行不区分大小写的搜索?

regex - sed - 使用捕获组打印翻译后的十六进制