找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 7157|回复: 1

[其它] CString和string的互相转换

[复制链接]

96

主题

158

回帖

4

精华

核心会员

积分
6513
发表于 2012-5-14 23:13:21 | 显示全部楼层 |阅读模式

CString->std::string 例子:

CString strMfc=“test“;

std::string strStl;

strStl=strMfc.GetBuffer(0);

///////////////////////////

std::string->CString  例子:

CString strMfc;

std::string strStl=“test“;

strMfc=strStl.c_str();

30

主题

693

回帖

0

精华

钻石会员

积分
2815
发表于 2015-4-29 09:38:24 | 显示全部楼层
代码感觉不太易读 不过还是支持
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表