将float转换为LPCWSTR / LPWSTR

nXq*_*Xqd 2 c++ winapi

[win 32 C ++]

我不知道如何将float转换为LPCWSTR / LPWSTR或LPCWSTR <-> LPWSTR

非常感谢

Sam*_*eer 5

#include <sstream>
...
float f = 45.56;
wstringstream wss;
wss << f;
// wss.str().c_str() returns LPCWSTR
cout << wss.str() << endl;
...
Run Code Online (Sandbox Code Playgroud)