12345678910111213141516
#include <cstdio> #include <iostream> const char g_szFileName[] = "C:\\error.txt"; int main () { std::cout << "Press any key to delete " << g_szFileName; std::cin.get(); if ( remove ( g_szFileName ) == 0 ); // remove is defined in cstdio std::cout << "\nSuccess !"; else std::cout << "\nError in deleting"; return 0; }