CString和string的互相转换


http://www.cppblog.com/yuanyajie/archive/2006/12/14/16427.html

 

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();
发布了146 篇原创文章 · 获赞 13 · 访问量 71万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章