iostream
is one of the CPP Stream used for reading and writing into a program with the help of cin and cout.
Reading and writing into file can also be done using fstream
standard library in files. fstream must be used as header file while doing input and output operations to a file along with iostream.
CPP Stream | Description |
---|---|
ofstream (taken from ostream) | ofstream represents the output file stream and can be used to create files and to write data into files |
ifstream (taken from istream) | ifstream represents the input file stream and can be used to read data from files |
fstream (taken from iostream) | fstream represents both ofstream and ifstream and can be used to create files, writes data to files and read data from files. |