convert wstring to string code example Example: wstring to string std::string str(wstr.begin(), wstr.end());