convert from wchar_t to std wstring
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
The
basic_string
class which constructs thewstring
object has multiple overloaded constructors to do this. To constructwstring
from a singlewchar_t
character do the following -wchar_t Char = L'A';
std::wstring strChar(1, Char);Here
1
is the repeat count ofChar
s to be added towstring
. To constructwstring
from an array ofwchar_t
characters it is more straight forward -wchar_t* Array = L"Hello";
std::wstring strArray(Array);«_Superman_»
I love work. It gives me something to do between weekends.