Platform::String ^SrcString = "abc";
std::wstring tmpW(SrcString ->Begin());
std::string tmpA(tmpW.begin(), tmpW.end());
char* DstString = tmpA.c_str(); // Error C2240
fix C2440 Error
Platform::String ^SrcString = "abc";
std::wstring tmpW(SrcString ->Begin());
std::string tmpA(tmpW.begin(), tmpW.end());
const char* DstString = tmpA.c_str();
std::string tmpA(tmpW.begin(), tmpW.end());
const char* DstString = tmpA.c_str();
沒有留言:
張貼留言