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