// Code that writes to a file // By Eric Marcarelli FILE *hFile; // <-- Must go at the beginning of the function // The rest can be put anywhere you want to write a file hFile = fopen ("FILENAME.TXT", "w"); fprintf (hFile, "TEXT TO WRITE TO FILE"); fclose (hFile);