Self Destruct Program

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 ^^
Sure. The cpp file isn't even used by the executable; they are completely separate files.
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
Ohh..
I'll try using the remove function.
That should work right?
I'm just curious.

Thanks
Only one way to find out. Go test your theory lol.
Topic archived. No new replies allowed.