I’ve got a class and one of its functions is to type out some information with the help of previous functions.
string printResult()
{
string result;
cout<<"\n"<<getName()<<" bla bla bla "<<getPoints()<<" blabla.";
return result;
}
Where getName and getPoints are obviously those other functions.
My question is:
How should I redo/change this part
cout<<"\n"<<getName()<<" bla bla bla "<<getPoints()<<" blabla.";
to become a string of its own which I can return,with this exact content?
Use a
stringstream