Professional Documents
Culture Documents
File Handling
Introduction to File Handling
Data entered once, required later again Same Data to be used by others Data required again by the same program
Program
Input
Stream Files
Output
Stream
I/O Streams
Stream
cin cout cerr
Description
Standard input stream Standard output stream Standard error stream
ifstream
Input file stream Class open() is a member function of the class ifstream Inherited functions of ifstream class, from the class istream are
get() getline() read() seekg() tellg()
ofstream
Output file stream Class open() is a member function of the class ofstream Inherited functions of ofstream class, from the class ostream are
put() write() seekp() tellp()
fstream
It supports files for simultaneous input and output fstream is derived from
ifstream ofstream iostream
fstream
Member functions of the class fstream
open close close all seekg seekp tellg tellp
Function in C++
Function Prototype Function Call Function Definition