64,650
社区成员
发帖
与我相关
我的任务
分享
char *c =
"姓名:小王" "\r\n"
"性别:男" "\r\n"
"年龄:13" "\r\n";
#include <sstream>
stringstream ss;
ss << "姓名:小王" << endl;
ss << "性别:男" << endl;
ss << "年龄 : 13" << endl;
string tmp(ss.str());
const char* c = tmp.c_str();
cout << c << endl;