wagar (11/04/82)
I resent Lew Mammel's implication that I would submit a self-printing C program that didn't work. The original program I posted did not have a trailing newline; I just didn't make it clear where the program began and ended. There is no requirement that C programs end in newlines. The program I submitted is, I believe, the shortest possible self-printing C program, given the standard i/o library. David Sher (rocheste!sher) was more responsible than I in concocting it. A less-ugly self-printing C program, with a new line, follows. Requiring a more standard "C style" is fairly irrelevant to the idea of a self-printing program, so I ignored that aspect. ------------------------------------ main(){char q=34,n=10,*a= "main(){char q=34,n=10,*a=%c%c%s%c;%cprintf(a,n,q,a,q,n,n);}%c"; printf(a,n,q,a,q,n,n);} ------------------------------------ I'm glad I have stirred up enough interest to get people to write some self-printing programs. I would like to see some self printing programs that perform some "useful" task in addition to printing themselves. -Steve Wagar