RSS
 

C++: Delete or remove a file

15 Jun

To delete or remove a file in C++ you can use the remove function from stdio.h like follows:


#include 

int main(){ if(remove("myfile.txt") == -1)

    fprintf(stderr,"Remove failed");

// your code .......

}
 
No Comments

Posted in C++

 

Leave a Reply