I desperately try to write in a ostringstream and then transfert the datas in the istringstream of an other object or in a file.
std::ostringstream oss;
oss << "Hello World";
For the first purpose, I try this :
iss.basic_ios<char>::rdbuf(oss.rdbuf());
But a simple "iss.str()" return nothing at all. (First problem)
Then when I try that :
std::ofstream ofs("test.txt");
ofs << oss.rdbuf();
ofs.close();
Nothing is written in the file test.txt. (Second problem)
Thank you in advance for any explanation of the inside relation between stringstream and streambuf.