Chinaunix首页 | 论坛 | 博客
  • 博客访问: 24589
  • 博文数量: 13
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 150
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-24 15:55
文章分类
文章存档

2008年(13)

我的朋友
最近访客

分类: WINDOWS

2008-06-08 22:26:18

工作中涉及到标准库的string与MFC的CString互转的问题
下面是个例子

  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();
阅读(425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~