I have a function within a large project of the form given below (func is called 5 times within the call hierarchy in some Abc class) :
void Test::func(std::string c)
{
cout<<c;
}
The function func is called by some functions in a large hierarchy. But all that the function func does is printing a string. Now instead of printing the string I want to store its output somewhere(in vector form) so that I may use it later in the program at the point where the hierarchy of func begins. I am completely clueless as to how should I capture this output instead of printing it. CAN SOMEONE PLEASE HELP.
I want to define my own data structure whereby I can store it...but I am not getting how??