What is A File Pointer?




What is A File Pointer?

All I/O streams objects have, at least, one internal stream pointer.

ifstream, like istream has a pointer known as the get pointer that points to the element to be read in the next input operation.

ofstream, like ostream, has a pointer known as the put pointer that points to the location where the next element has to be written.

fstream, inherits both, the get and the put pointers from iostream.

These internal stream pointers that point to the reading or writing locations within a stream are called as file pointers and can be manipulated using the following member functions −

  • Tellg() and Tellp()

  • Seekg() and Seekp()