< Intro To C++
<fstream> library and files
The standard C++ <fstream> library provides functions for working with files and can be used by adding an #include <fstream> directive at the start of the program.The declaration is as follows:
filestream-object object-name("file-name",modes)
The ofstream object is a filestream for writing data to the file and ifstream object is for reading data from the file. The ofstream object is used like the cout function that writes to standard output and the ifstream object works like the cinfunction that reads from standard input.
#include <iostream>;
using namespace std;
int main{
return 0;
}
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.