How to delete a file from the D: \ Files \ 1.txt directory on C? without messages and confirmations

#include < stdio.h > // Для printf, remove int main (void) { printf (“Удаление файла: ”); // Удаление файла if (-1 == remove (“test.txt”)) printf (“Ошибка\n”); else printf (“Выполнено\n”); return 0; } 

    1 answer 1

    Well, so and remove -

     remove("D:\\Files\\1.txt"); 

    If the access rights allow, the file is not opened by anyone, the ReadOnly attribute is not present - will be deleted without messages and confirmations :)

    • Harry, can you write all the code? which you can compile right away ... very necessary :) - Elena
    • Well, here it is - remove("D:\\Files\\1.txt"); ... - Harry
    • in the code what to remove and what to add in order to simply compile into the .exe that I presented to you above in the question) - Elena
    • @Eva, pastebin.com is waiting for you. - 0andriy