Mega Code Archive
Categories
/
C
/
Code Snippets
Delete a file sample
#include
#include
#include
int main(void) { char fname[80]; printf("Enter name of file to delete: "); gets(fname); printf("Are you sure? (Y/N) "); if(toupper(getchar())=='Y') remove(fname); return 0; }