fgetpos - Moves the file position pointer which is from fgetpos() in C


#include <stdio.h>
  #include <stdlib.h>

  int main(int argc, char *argv[])
  {
      FILE *fp;
      fpos_t file_loc;

      if((fp=fopen("test","r"))==NULL) {
          printf("Cannot open file.\n");
          exit(1);
      }
   
      fgetpos(fp, &file_loc);

      fsetpos(fp, &file_loc);
     
      fclose(fp);
return 0;
  }