The get position is the position for the next read operation. The put position is the position for the next write operation.

Normally the put position is at the end of the file, and the get position starts at the beginning of the file. fs.seekg(n, ios::beg); moves the get positions to character n counted from the beginning of the file fs, while fs.seekp(n, ios::beg); does the same for put.

You can determine their current position with:

     long n = fs.tellg();
     or
     long n = fs.tellp();
				

The number returned by the tellg() and tellp() functions is of type long because file sizes can be quite large, and an integer may not suffice to express a file position.