从stringstream中提取,从一个函数传递到另一个函数

Extract from stringstream, pass from one function to the other

本文关键字:函数 一个 另一个 stringstream 提取      更新时间:2023-10-16

我想从ss:

中提取字符串结构

from here:

int XXX()
{
ss<< "text" << int var;
}

:

writeOutput (ss.str () .fout)

很难理解你真正想要的是什么,但是听起来就像你想要这样的东西:

int XXX()
{
    std::ostringstream ss;
    ss << "text" << someintvar;
    writeOutput(ss.str(), fout);
}
相关文章: