How to write a program such that it will delete itself after exectution?

Showing Answers 1 - 2 of 2 Answers

sumit kumar

  • May 9th, 2006
 

#include#includevoid main(){printf("hello");getch();remove(ab.c); //where ab.c is the file name}

  Was this answer useful?  Yes

Super C

  • Sep 26th, 2007
 

#include <stdio.h>

main(int argc, char *argv[])
{
  printf("Removing: %s...n", argv[0]);
  remove(argv[0]);
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions