VC 中怎样将CString型的数据转换成const char*型的数据

[复制链接]
查看11 | 回复1 | 2012-10-10 22:29:17 | 显示全部楼层 |阅读模式
char *buf; CString str = "hello "; 1.buf = (LPSTR)(LPCTSTR)str; 2.strcpy(buf,str); 3.char szTemp[500]; CString strTemp = "123456789 "; memset(buf,0,sizeof(str)); sprintf(buf, "%s ",str); 4.memset(buf,0x00,100); memcpy(buf,(LPCSTR)str,str.GetAllocLength()); 5.char *buf=str.GetBuffer(0);...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行