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; 
posted on 2010-09-24 20:47  一路前行  阅读(1549)  评论(0编辑  收藏  举报