My site has been moved!

You should be automatically redirected in 6 seconds. If not, visit
http://www.hackagenius.co.cc
and update your bookmarks.




A Self Destructing Program in C

Posted by smit sanghvi Monday, November 2, 2009

This program will destroy itself upon execution.The program will cause the .exe file to be deleted upon execution.That is this program is capable of destroying itself upon execution.Heres the code

#include
#include
#include
void main()
{
printf(”This program will destroy itself if u press any key!!!\n”);
getch();
remove(_argv[0]);/*array of pointers to command line arguments*/
}

HOW TO COMPILE ?
Load the source code to the compiler and compile(press Alt-F9) and then press F9.This will generate the .exe file in the current directory(Bin directory).Execute this .exe file it will destroy itself upon execution.

0 comments

Post a Comment

Visit our new website

Our Newsletter

Enter your email address To Subscribe Us Via Email:

Our SMS Updates