basic_ostream
ostream
wostream
Output stream class
iostream library
  cplusplus.com  

Standard hierarchy

ios_base
--->
ios
--->
ostream
--->
iostream
  --->
ofstream
  --->
ostringstream

Public member functions:

ostream members:
(constructor)Construct an object
operator<<Perform a formatted output operation (insertion).
flushFlush buffer.
putPut a single character into output stream.
seekpSet position of put pointer.
tellpGet position of put pointer.
writeWrite a sequence of characters.
(destructor)No-op [virtual]
members inherited from ios:
operator void *Convert stream to pointer.
operator !Evaluate stream object.
badCheck if an unrecoverable error has occurred.
clearSet control states.
copyfmtCopy formatting information.
eofCheck if End-Of-File has been reached.
exceptionsGet/set the exception mask.
failCheck if failure has occurred.
fillGet/set the fill character.
goodCheck if stream is good for i/o operations.
imbueImbue locale.
narrowNarrow character.
rdbufGet/set the associated streambuf object.
rdstateGet control state.
setstateSet control state.
tieGet/set the tied stream.
widenWiden character.
members inherited from ios_base:
flagsGet/set format flags.
getlocGet current locale.
imbueImbue locale.
iwordGet reference to a long element of the internal extensible array.
precisionGet/set floating-point decimal presision.
pwordGet reference to a void* element of the internal extensible array.
register_callbackRegister event callback function.
setfSet some format flags.
sync_with_stdioActivates / Deactivates synchronization with cstdio functions. [static]
unsetfClear format flag.
widthGet/set field width.
xallocReturn a new index for the internal extensible array. [static]

Description

ostream provides member functions to perform output operations with a stream buffer. These members can be divided into two main groups:
Formatted output
These member functions write data in a human-readable way following the stream's formatting information. All formatted output is done using the insertion operator (operator<<).
Unformatted output
Most of the other member functions of ostream class are used to perform unformatted output, i.e. output operations that write data as it is, without performing any formatting adaptation. These functions can put a dertermined number of characters to the output buffer (put, write) and manipulate the position of the put pointer (seekp, tellp).
  The output buffer may be flushed to the external device by calling member flush.

  Standard objects cout, cerr and clog are instatiations of this class.


© The C++ Resources Network, 2001