Domanda

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

Thank you.

È stato utile?

Soluzione

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

LPCWSTR str=L"fun";
wstring str2(str);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top