I have a class that recieves a cout in the constructor ( ostream* )
1 2 3 4
SO::SO(ostream* s)
{
//constructor logic
}
so in the main I have:
SO so(&cout);
I have overloaded some operators for this class, and each overload accepts a parameter (int string float or whatever) and should write this value on the screen, but not using cout << but the " s " parameter from the constructor.
How do I do this? I gess the steps are:
1) in the constructor, save s into a private member
2) replace cout with that private member
but I cant find an example and I'm getting errors whatever I try