Input file stream class


ifstream provides an interface to read data from files as input 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 istream

Member functions inherited from ios

Member functions inherited from ios_base