How can I delete a file pointed to by a FILE* in C?

前端 未结 5 1579
予麋鹿
予麋鹿 2021-01-19 04:56
#include

int main() {

    FILE* fp;
    fp = fopen(\"temp.txt\", \"w\");
    fprintf(fp, \"Hello, World!\\n\");

    // remove(\"temp.txt\");  this          


        
5条回答
  •  自闭症患者
    2021-01-19 05:15

    You closed pointer, then her value was freed, how you imagine delete file by this handle?

提交回复
热议问题