I wanna write a C++ program that can print out the source code of the program, but this program can't be read any file.
Can anyone give me some hints?
thx!!
I wanna write a C++ program that can print out the source code of the program, but this program can't be read any file.
Can anyone give me some hints?
thx!!
I think Salem had a sig that did this.....at least I think it was him......I'll have a root around to see if I still have it...
Like so
Ok, so it's CCode:char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
If you want to know more - such programs are called quines
http://www.google.com/search?q=quine
He he...thats cool.....
I remember when I compiled it and sat scratching my head as the code was being spat back out at me.....