Stream I/O Functions
The overloaded left-shift operator <<, taking an ostream object as its first argument, will print the contents of an object in human-readable form. Conversely, the overloaded right-shift operator >>, taking an istream object as its first argument, will read and parse an object from the stream in a human-understandable format.
 
ostream& operator<<(ostream& ostr, const ClassName& x);
istream& operator>>(istream& istr, const ClassName& x);
The overloaded left-shift and right-shift operators contrast with the persistence operators:
 
RWvostream& operator<<(RWvostream& vstream, const ClassName&);
RWvistream& operator>>(RWvistream& vstream, ClassName&);
Although the persistence shift operators may store and restore to and from a stream, they will not necessarily do so in a form that could be called “human-readable.”