64 638
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #528 in C++ for angel

Question #528
How can I make my class to be output into I/O streams?
Expert's answer
To do this you have to overload operators “and”. But if you want your class objects to be printed to the standard I/O streams you have to overload these operators in the form of external functions. Signature of overloading ostream& operator<<(ostream& os, const Foo& s). Note that the overloaded function must be a friend of your class if you want to show the flow of private data members of the class.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions