The input streams are sequence of characters that move from input device like keyboard to the program/computer. The output streams are sequence of characters that move from program/computer to an output device like monitor.
The stream classes supported by C++ for file input and output:
1. fstreambase:
class provides facilities for file operations and consists of open() and close() member functions. This is base class for fstream, ifstream and ofstream.
2. Ifstream:
class supports read operations and consists of open () with default input mode and inherits function get(), getline, read() , seekg(), tellg() from istream class defined inside iostream.h file.
3. ofstream:
class supports output operations and consists of open() with default output mode. It inherits the function put(), write(), seekp() and tellp() from ostream.
4. fstream():
class supports both input and output operations. It contains open() with default input mode and inherits all the functions from istream and ostream classes through iostream. filebuf class sets the file buffer to read and write.