Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ios.UUCP Path: utzoo!linus!decvax!decwrl!sun!idi!ios!daves From: daves@ios.UUCP (David B. Schnepper) Newsgroups: net.sources Subject: 62 char C self repeater (cheater) Message-ID: <162@ios.UUCP> Date: Wed, 22-Aug-84 15:49:11 EDT Article-I.D.: ios.162 Posted: Wed Aug 22 15:49:11 1984 Date-Received: Thu, 23-Aug-84 07:38:46 EDT Organization: Integrated Office Systems, Cupertino CA Lines: 25 Here's another repeater, much shorter than the 101 record that I've seen so far. I consider this one a cheater, as it is possible to break it. --------------cut line--------------- main(){char b[80],i=open(__FILE__,0);read(i,b,80);printf(b);} --------------end cut---------------- This program reads in its source and writes it. Will fail if the source is not present when run. Also assumes your cpp has the "__FILE__" construct (is that standard?). It DOES pass the cc file.c a.out >tmp cmp tmp file.c test. The program can be made shorter if we assume the file name is "y.c" or somesuch. (Replace __FILE__). I **don't** consider this a proper entry in the "shortest c" contest, as the executable will not always reproduce its source. Dave Schnepper ios!daves