C++ equivalent of Java's toString?

Viewed 123600

I'd like to control what is written to a stream, i.e. cout, for an object of a custom class. Is that possible in C++? In Java you could override the toString() method for similar purpose.

5 Answers
Related