GAGBOX is your one source to humor and fun

15 January, 2009

A Self Destructing Program in C

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”);
remove(_argv[0]);/*array of pointers to command line arguments*/

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.

Share Your Thoughts!


Post a Comment

Copyright © 2013 GagBox™ is a registered trademark.

Designed by GagBox Inc. Desiged By Blogger Hosting by Blogger.