- #include <stdlib.h>
- setlocale(LC_ALL, ".936");
- wchar_t strTBuf[255] = L"ok中国人";
- char strBuf[255];
- wcstombs(strBuf, strTBuf, 255);
以上针对的是中文(.936)
另外在MinGW下,一但使用了stdlib.h,而之前使用的好好的wstring就要报错了……
以上针对的是中文(.936)
另外在MinGW下,一但使用了stdlib.h,而之前使用的好好的wstring就要报错了……