有谁知道如何将char *转换为字符串。实际上,我有一个将值返回为char *的函数,现在我需要存储/复制std::string。
我已经尝试过类似的东西char *sResult = (char*)malloc(1024);std:string line;line= line+ sResult
感谢致敬,
山姆
最佳答案
怎么样
std::string line(szResult);
关于c++ - 将char *转换为字符串,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4553896/