#include <stdio.h>
void main(void) {
  FILE *fp;
  fp = fopen("myfile.txt","w+");
  fputs("This is Book", fp);
  // Set file pointer to the given position
  fseek(fp, 7, SEEK_SET);
  fputs("Kenny Wong", fp);
  fclose(fp);
}

set the file pointer to the given position

Comments