◄ostream► ◄Up► ◄Contents► ◄Index► ◄Back► ──The Microsoft iostream Classes──────────────────────────────────────────── Description The ofstream class is an ostream derivative specialized for disk file output. All of its constructors automatically create and associate a filebuf buffer object. The filebuf class documentation describes the get and put areas and their associated pointers. Only the put area and the put pointer are active for the ofstream class. #include <fstream.h> See Also ◄filebuf►, ◄streambuf►, ◄ifstream►, ◄fstream► Public Members Construction/Destruction ◄ofstream► Constructs an ofstream object. ◄~ofstream► Destroys an ofstream object. Operations ◄open► Opens a file and attaches it to the filebuf object and thus to the stream. ◄close► Flushes any waiting output and closes the stream's file. ◄setbuf► Associates the specified reserve area to the stream's filebuf object. ◄setmode► Sets the stream's mode to binary or text. ◄attach► Attaches the stream (through the filebuf object) to an open file. Status/Information ◄rdbuf► Gets the stream's filebuf object. ◄fd► Returns the file descriptor associated with the stream. ◄is_open► Tests whether the stream's file is open. -♦-