#include <iostream>
#include <sstream>
std::stringstream ss;
ss<<"dfsdf"<<"sdfasdf";
std::string str(ss.str());
const char *arr = str.data();
C++中的 stringstream
原文:https://www.cnblogs.com/mathyk/p/9813796.html