in C++ by (13.4k points) edited by
0 like 0 dislike

How I can convert std::wstring to const wchar_t* data type in C++?

1 Answer

0 like 0 dislike
by (13.4k points)

Use method c_str() of std::wstring like this:

std::wstring foo = L"some text";
const wchar_t* bar = foo.c_str();

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.