CString 转换成string
我用的vs2012
------解决方案--------------------
unicode:
CString sz1 = L"abc";
std::string sz2 = CT2A(sz1.GetBuffer()); //转化为非unicode.
非unicode:
CString sz1 = "abc";
std::string sz2 = sz1.GetBuffer();
本文详细介绍了在Visual Studio 2012中如何将CString转换为string。针对Unicode和非Unicode环境,提供了具体的代码示例,展示了使用CT2A函数进行转换的方法。
CString 转换成string
我用的vs2012
------解决方案--------------------
unicode:
CString sz1 = L"abc";
std::string sz2 = CT2A(sz1.GetBuffer()); //转化为非unicode.
非unicode:
CString sz1 = "abc";
std::string sz2 = sz1.GetBuffer();
588

被折叠的 条评论
为什么被折叠?