Thursday, 24 March 2011

A Self Destructing Program in C

Posted by Ankit at 00:43


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
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.



If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you subscribe to my regular Email Updates. Subscribe Now!


Kindly Bookmark and Share it:

YOUR ADSENSE CODE GOES HERE

0 comments:

Have any question? Feel Free To Post Below:

Blog Archive

 

Popular Posts

Recent Comments

© 2011. All Rights Reserved | Krackhack | Template by Blogger Widgets

Home | About | Top