标签:
char ch[1024] = "wo shi ni baba"; int num = MultiByteToWideChar(0, 0, ch, -1, NULL, 0); wchar_t *wide = new wchar_t[num]; MultiByteToWideChar(0, 0, ch, -1, wide, num); //查看转换好的结果 cout << wide[3] << endl; //LPCTSTR 转换成 char * wchar_t widestr[1024] = L"wo shi ni yeye"; int num1 = WideCharToMultiByte(CP_OEMCP, NULL, widestr, -1, NULL, 0, NULL, FALSE); char *pchar = new char[num1]; WideCharToMultiByte(CP_OEMCP, NULL, widestr, -1, pchar, num1, NULL, FALSE); //查看转换好的结果 cout << pchar[1] << endl;
标签:
原文地址:http://www.cnblogs.com/bksqmy/p/4552355.html