分享到:
发表于 2010-09-30 11:55:36 楼主 | |
编程过程中,有时会需要把CString类型字符串转换成数组进行操作,以下给出三种方法来实现: 方法一: 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; |
|
楼主热贴
个性签名:无
|
针对ZOL星空(中国)您有任何使用问题和建议 您可以 联系星空(中国)管理员 、 查看帮助 或 给我提意见