개발/C++
[C++] wstring to int, int to wstring
aaamy91
2021. 8. 17. 07:00
https://stackoverflow.com/questions/23165199/converting-a-stdwstring-to-int
Converting a std::wstring to int
I presume this to be very simple but I cannot get it to work. I am simply trying to convert a std::wstring to an int. I have tried two methods so far. The first is to use the "C" method with "at...
stackoverflow.com
std::wstring ws = L"456";
int i = std::stoi(ws); // convert to int
std::wstring ws2 = std::to_wstring(i); // and back to wstring