HEADER FILES
So far, 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:
Data Type Description
ofstream This data type represents the output file
stream and is used to create files and to
write information to files.
ifstream This data type represents the input file
stream and is used to read information from files.
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.
To perform file processing in C++, header files <iostream>
and <fstream> must be included in your C++ source file.
No comments:
Post a Comment