Open file to read and another to write to. Read from first file and write contents into second file. Close the file.
Default path is file where scripts are held/where compiled from
FILE *ptr, *ptr1;
ptr = fopen("file name/path", "mode");
ptr1 = fopen("file name/path", "mode");
open and write to file etc
fclose("ptr"); //closes and saves file
fclose("ptr1"); //closes and saves file