you can use a std::stringstream for this. it works exactly like cin/cout, except it stores its data in a string, instead of reading/writing the console.


#include <iostream>
#include <sstream>...