Question: how to convert wchar_t to string?
Answer: wchar_t* characters=L"Test"; std::wstring string(characters); You do not have to use a constructor containing String. begin() and String. end() because the constructor of std::wstring automatically allocates memory for storing the array of wchar_t and copies the array to the allocated memory.