How do I convert a char string to a wchar_t string?

c++, string, windows

Solution

Does this little function help?

#include <cstdlib>

int mbstowcs(wchar_t *out, const char *in, size_t size);

Also see the C++ reference

Problem

I have a string in `char*` format and would like to convert it to `wchar_t*`, to pass to a Windows function.

Original source