1 2 3 4 5 6 7 8 9

*

For istreams we have the following three functions:

istream& seekg (streampos);istream& seekg (streamoff, seek_dir);
streampos tellg ();

These functions operate in the same way as the corresponding ostream functions
They have been assigned different names, since a stream can be used for both input and output. Therefore, a value of stream class could have an istream and an ostream side, and both could be active at the same time By having two sets of functions the position we are reading from could be different from the position we are writing to, even in the same file

*

*

*

The fstream Classes

*

the fstream classes are designed for reading and writing files, there are
three related classes:

ifstream- input from a file
ofstream- output to a file
fstream- both input and output to a file

23 March, 1998

Page 7