delete file c
#include <iostream>
#include <cstdio>
int main() {
const char* filename = "example.txt";
// Attempt to delete the file
if (remove(filename) != 0) {
perror("Error deleting the file");
return 1;
}
std::cout << "File deleted successfully.\n";
return 0;
}