char* ch1="1234";
AfxMessageBox((CString)ch1);
//正常;
char ch2[4]={'1','2','3','4'};
AfxMessageBox((CString)ch2);
//结尾乱码
实际上ch1内容是"1234/0"
char ch2[5]={'1','2','3','4','/0'};
AfxMessageBox((CString)ch2);
//正确
反过来转换
char* ch2 =new char[s.GetLength()];
strcpy(ch2,s.GetBuffer(0));
//如果报 w_char*不能转为_char*,设置项目默认字符集为多字节字符集