Networking, Programming and Graphics Tutorials

Function for manipulation file pointers - C++ [2/2]

Seekg() function moves the associated file's yet pointer while seekp() function moves the associated file put pointer. The table shown some of the sample pointer offset calls and their actions.

Seek call Action
seekg(0,ios::beg); Go to the start
seekg(0,ios::cur); Stay at the current position
seekg(0,ios::end); Go to the end of the file
seekg(m,ios::beg); Move to (m+1 )th byte in the file
seekg(m,ios::cur); Go forward by m bytes from the current position
seekg(-m, ios::cur); Go backward by m bytes from the current position
seekg(-m, ios::end); Go backward by m bytes from the end
Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - Function for manipulation file pointers - C++ [2/2] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: file pointers and manipulation c++  file pointers and manipulation c++  file pointers and their manipulation  usage of file pointers and their manipulation in c++  Functions for manipulation of file pointers  Function for manipulation of FIle pointer  Function for manipulation of FIle pointer  manipulation of pointers c++  manipulation of pointers  c++ file manipulation