怎么把一个CString 转化为 char * 怎么把一个CString 转化为 char *??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接用类型强制也可以,不过可能不如CString类的GetBuffer好CString str;char *str1;strcpy(str1,(LPTSTR)(LPCTSTR)str); strcpy(str1, str.GetBuffer(str.GetLength())); CString strTemp;char* pch = (LPTSTR)(LPCTSTR)strTemp; CString str;char *str1;str1= (char *)malloc(sizeof(char) * str.GetLength()+1);memcpy(str1, str.GetBuffer(str.GetLength()+1), str.GetLength()); CString csStr;char chStr[100];strcpy(chStr, csStr.GetBuffer(csStr.GetLength()));直接拷贝和强制转换都是可以实现的。 mfc中activex的可视化问题 关于工具栏右边的颜色。 视频传输问题 100分~~,求一个思路~~ 如何用scm启动 我用ATL写的服务程序 怎样把字符串类型(CString)转化为CTime类型? 用lcc32制作dll PostMessage后台鼠标如何实现 我用了skinmagicSDK以后,自己画的图显示不出来 图像平滑缩放的例子 100分求助VC++6.0下载地址!最好不要FTP! 请教 Winsock 程序的问题
CString str;
char *str1;
strcpy(str1,(LPTSTR)(LPCTSTR)str);
CString strTemp;
char* pch = (LPTSTR)(LPCTSTR)strTemp;
char *str1;
str1= (char *)malloc(sizeof(char) * str.GetLength()+1);
memcpy(str1, str.GetBuffer(str.GetLength()+1), str.GetLength());
char chStr[100];strcpy(chStr, csStr.GetBuffer(csStr.GetLength()));直接拷贝和强制转换都是可以实现的。