jacob-tate
2/8/2020 - 4:38 AM

Convert strings in c++

// Assuming unicode
#include <string>
wchar_t path[FILENAME_MAX] = { 0 };
GetModuleFileNameW(nullptr, path, FILENAME_MAX);
	
std::wstring wide_string(path);
std::string result_string(wide_string.begin(), wide_string.end());