【VC++】CString与std::string互转

来源:互联网 发布:个人免费域名注册 编辑:程序博客网 时间:2024/05/17 07:09

CString cStr(_T(“hello”));
std::string str;

CString–>std::string
str=CW2A(cStr.GetString());

std::string–>CString
cStr=str.c_str();