Xref: utzoo comp.lang.misc:5474 comp.lang.c:31868 Path: utzoo!attcan!uunet!maverick.ksu.ksu.edu!umriscc!mcs213j.cs.umr.edu!jeffj From: jeffj@mcs213j.cs.umr.edu (Jeff Jenness) Newsgroups: comp.lang.misc,comp.lang.c Subject: Re: Self-printing C program Summary: Self reproducing C program Message-ID: <1400@umriscc.isc.umr.edu> Date: 16 Sep 90 22:01:48 GMT References: <38724@unix.cis.pitt.edu> Sender: news@umriscc.isc.umr.edu Followup-To: comp.lang.misc Organization: University of Missouri - Rolla Lines: 20 In article <38724@unix.cis.pitt.edu> meyer@unix.cis.pitt.edu (Timothy S. Meyer) writes: > >Seems to me I saw a self-printing C program a few years back in CACM or >Computer magazine, but I can't seem to find it. Can anyone give me a >reference for such a program? (A self-printing program is one that >outputs a copy of its own text and is more of a recreational interest I >think.) > >Any help will be appreciated. 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);} Hope this helps, -- Jeff Jenness University of Missouri - Rolla jeffj@cs.umr.edu