class fstream : public iostream

Description

The fstream class is an iostream derivative specialized for combined disk file input and output. Its constructors automatically create and attach a filebuf buffer object.

The filebuf class documentation describes the get and put areas and their associated pointers. Although the filebuf object's get and put pointers are theoretically independent, the get area and the put area cannot both be active at the same time. Therefore, when the stream's mode changes from input to output, the get area is emptied and the put area is reinitialized. When the mode changes from output to input, the put area is flushed and the get area is reinitialized.

#include <fstream.h>

See Also

ifstream, ofstream, strstream, stdiostream, filebuf