locale loc( "chs" );//定义“区域设置”为中文方式
wcout.imbue( loc );//载入中文字符输入方式
wchar_t str[]=L"中国";//定义宽字符数组,注意L...是大写
wcout数组,下同
wprintf(str);
system("pause");
wchar_t 转换为char 的代码如下:
有如下的wchar_t和char...我们可以发现另外一个问题,wchar_t的高位字节应该存储在char数组的低位字节。...用system("pause>nul") 就可以了
wchar_t*,wchar_t,wchat_t数组,char,char*,char数组,std::string,std::wstring,CString...::string& szStr, std::wstring& wszStr )
{
int nLength = MultiByteToWideChar( CP_ACP, 0, szStr.c_str()