I have had a small program written for me that writes information to a text file and then uses it again later. I have tried to contact the original programmer but haven't been successful
My problem is that the text file is open at the start of the program
Code:
fp = fopen("C:\\info.txt", "w"); //'W' should wipe any info already in file, 'A' is for append
but the following code is used to put the information into the text file
Code:
fflush(fp);
char *szData = g_Data.GetString();
fprintf(fp, szData);
which results on the information being appended to info.txt, not what I was after!
My problem is - How do I delete what's in the file before I write the data to the file?