Is it safe and acceptable to opening a file and immediately close it to simply remove its contents.
FILE *fp = fopen("file_name.dat","w");
fclose(fp);
I try it and works fine for me. what is recommended method? Please explain other way(s) of doing it. Not duplicate of truncate file I want to know is this way to remove a file true because I guess it and not read it in any books