I want to save a location in file, and later restore the file pointer to the saved location.
FILE *save = fp;
//perform operations on file fp...
..
..
//restore to previously saved location
fp = save;
I tried the above method, but it does not work.
See this page for information about the
ftellandfseekfunctions. These will allow you to retrieve and set the position of the file pointer, respectively.