ostream_withassign::operator =

ostream& operator =( const ostream&_os );

ostream& operator =( streambuf*_sp );

Remarks

The first overloaded assignment operator assigns the specified ostream object to this ostream_withassign object.

The second operator attaches a streambuf object to an existing ostream_withassign object, and initializes the state of the ostream_withassign object. This operator is often used in conjunction with the void-argument constructor.

Example

filebuf fb( "test.dat" ); // Filebuf object attached to "test.dat"
cout = &fb;         // fb associated with cout
cout << "testing"; // Message goes to "test.dat" instead of stdout

ostream OverviewOutput Stream Classes

See Also   ostream_withassign::ostream_withassign, cout