Reposition stream's pointer indicator: how to use fseek : File Content Search « File « C / ANSI-C






Reposition stream's pointer indicator: how to use fseek



#include <stdio.h>

int main ()
{
  FILE *file;
  file = fopen ("my.txt","w");
  
  fputs ("This is a line.", file);
  fseek (file, 19, SEEK_SET);
  
  fputs ("Hiiiiiiiiiiiii", file);
  fclose (file);
  return 0;
}

           
       








Related examples in the same category

1.File content seek
2.Seek a byte in file
3.Seek array element in a file
4.Search specified file for specified character