convert string to wstring c++ code example Example: string to wstring conversion c++ string str = DATA_DIR; std::wstring temp(L"%s",str);