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

amu*_*iar 2 c++ hex

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

Ker*_* SB 8

与窄字符串相同:

#include <iomanip>
#include <sstream>

//...

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

return oss.str();         // type is std::wstring
Run Code Online (Sandbox Code Playgroud)