Knowledge in c++ streams

C++ Streams

we have been using the iostream standard library, which provides cin and cout methods for reading from standard input and writing to standard output respectively. This tutorial will teach you how to read and write from a file. This requires another standard C++ library called fstream, which defines three new data types − Sr.No Data Type & Description 1 ofstream This data type represents the output file stream and is used to create files and to write information to files. 2 ifstream This data type represents the input file stream and is used to read information from files. 3 fstream This data type represents the file stream generally, and has the capabilities of both ofstream and ifstream which means it can create files, write information to files, and read information from files.