#include<stdio.h>
int main() {
FILE* fp;
fp = fopen("temp.txt", "w");
fprintf(fp, "Hello, World!\n");
// remove("temp.txt"); this requires the filename as an argument
// removefile(fp); <--- is something like this possible?
return 0;
}
The remove function (defined in stdio.h) takes the file name as a parameter, but not the file pointer itself.
Is there some function in the C standard libraries that does file deletion, and takes file pointer as the arguement?