CString类型转为char数组
方法一:
char *p;
CString str="hello";
p=str.GetBuffer(str.GetLength());
str.ReleaseBuffer();
方法二:
CString str="hello";
char ch[20];
memcpy(ch,str,str.GetLength());
方法三:
char *ch;
CString str="hello";
ch=(LPSTR)(LPCTSTR)str;
char *p;
CString str="hello";
p=str.GetBuffer(str.GetLength());
str.ReleaseBuffer();
方法二:
CString str="hello";
char ch[20];
memcpy(ch,str,str.GetLength());
方法三:
char *ch;
CString str="hello";
ch=(LPSTR)(LPCTSTR)str;