Self Destruct Program

Apr 2, 2012 at 12:54am
Hey guys,
I was wondering if it is possible to create an application that deletes its own .cpp file.
I googled this but i couldnt understand most of what came up.
i use visual studio 2010 and my OS is wondows 7
Also sorry for the repost but i didnt get any replies last time.

Thankyou ^^
Apr 2, 2012 at 1:02am
Sure. The cpp file isn't even used by the executable; they are completely separate files.
Apr 2, 2012 at 1:07am
To make it simple, Yes you can create a program that delete's it's own .cpp file. why?
Well when you compile a program in you're compiler it creates a .exe that can be executable, meaning that it's a whole different file now, it no longer has anything to do with the .cpp that it use to belong to unless you over write the .exe with new code.
Last edited on Apr 2, 2012 at 1:08am
Apr 2, 2012 at 1:20am
Ohh..
I'll try using the remove function.
That should work right?
I'm just curious.

Thanks
Apr 2, 2012 at 2:10am
Only one way to find out. Go test your theory lol.
Topic archived. No new replies allowed.