Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
IOstream Library
manipulators
classes:
filebuf
fstream
ifstream
ios
iostream
ios_base
istream
istringstream
ofstream
ostream
ostringstream
streambuf
stringbuf
stringstream
objects:
cerr
cin
clog
cout
types:
fpos
streamoff
streampos
streamsize
ofstream
ofstream::ofstream
member functions:
ofstream::close
ofstream::is_open
ofstream::open
ofstream::rdbuf


ofstream

class
<fstream>

Output file stream

ofstream

ofstream provides an interface to write data to files as output streams.

The objects of this class maintain internally a pointer to a filebuf object that can be obtained by calling member rdbuf.

The file to be associated with the stream can be specified either as a parameter in the constructor or by calling member open.

After all necessary operations on a file have been performed, it can be closed (or disassociated) by calling member close. Once closed, the same file stream object may be used to open another file.

The member function is_open can be used to determine whether the stream object is currently associated with a file.

Public members


Members inherited from ostream



Member functions inherited from ios


Member functions inherited from ios_base