Delete files from a specific folder in C

前端 未结 1 1994
無奈伤痛
無奈伤痛 2021-01-28 17:01

I\'m trying to delete files from a specifc folder. My deleteFile() function only deletes on its home folder, not on /tmp folder which is what I need. I

相关标签:
1条回答
  • 2021-01-28 17:34

    You need to include the folder path in the argument to remove():

    char fullpath[40] = "C:/cygwin/tmp/";
    strcat(fullpath, filetodelete);
    status = remove(fullpath);
    
    0 讨论(0)
提交回复
热议问题