I would like to convert a LPCWSTR to wstring in C++ (VS 2010). I want to use this in OutputDebugStringW().

Thank you.

有帮助吗?

解决方案

Well just pass the LPCWSTR to the constructor of wstring like this:

LPCWSTR str=L"fun";
wstring str2(str);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top