Code:
// Snippet to delete files
//Written by nirvanarupali
#include <iostream>
using namespace std;
int main ()
{
if( remove( "C:\\File.txt" ) == -1 ) // You can change this to a directory
// of your file.
cout <<"Error deleting file";
else
cout <<"File successfully deleted";
return 0;
}
Change the directory where your file is located.