fseek() function
The fseek() function is used to set the file pointer to the specified offset. It is used to write data into file at desired location.
Syntax:- fseek(FILE *stream, long int offset, int whence)
There are 3 constants used in the fseek() function for where: SEEK_SET, SEEK_CUR and SEEK_END.Each have different role
1)SEEK_SET moves file pointer position to the beginning of the file.
2)SEEK_CUR moves file pointer position to given location.
3)SEEK_END moves file pointer position to the end of file.
2)SEEK_CUR moves file pointer position to given location.
3)SEEK_END moves file pointer position to the end of file.
Example:-
fseek() file handling function |
""SHARE it"""
Comments
Post a Comment