Function prototypes:int fseek (FILE *fp, LONG offset, int origin)
Parameter meaning: FP file pointer offset relative to Origin specified offset position the starting position of the origin pointer movement, can be set to the following three cases: Seek_set file start position seek_cur file Current location seek_end file end Location
Seep () and SEEKG () functions in C + +
SEEKP: Setting the file stream pointer location for the output file stream
SEEKG: Setting the file stream pointer location for the input file stream
Function prototype:
ostream& SEEKP ( Streampos POS);
ostream& SEEKP (streamoff off, Ios::seek_dir dir);
istream& seekg (Streampos POS);
istream& seekg (streamoff off, Ios::seek_dir dir);
Function Parameters
off: Value to offset
dir parameter is used to locate the file stream pointer, representing the starting position of the search
enumeration type defined in iOS:
enum seek_dir {Beg, cur, end};
Meaning of each enumeration constant:
ios::beg: Starting position of the file stream
iOS :: Cur: Current location of the file stream
Ios::end: End position of the file stream
C + + file pointer offset