Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!umriscc!mcs213j.cs.umr.edu!jeffj From: jeffj@mcs213j.cs.umr.edu (Jeff Jenness) Newsgroups: comp.lang.misc Subject: Re: Self-printing C program Message-ID: <1409@umriscc.isc.umr.edu> Date: 18 Sep 90 17:59:35 GMT References: <1400@umriscc.isc.umr.edu> <583@demott.COM> Sender: news@umriscc.isc.umr.edu Organization: University of Missouri - Rolla Lines: 18 In article <583@demott.COM> kdq@demott.COM (Kevin D. Quitt) writes: >> >>Here is an example of what you are looking for: >> >>char p[]="char p[]=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} >> > > Real close, but there's no newline. "printf" does not print a newline either! The newline within the text just delimits the original program line, it is not included as part of the program text. So in that case it will produce a duplicate of itself. -- Jeff Jenness University of Missouri - Rolla jeffj@cs.umr.edu