home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / SNIP9404.ZIP / ANSISELF.C < prev    next >
C/C++ Source or Header  |  1994-04-03  |  413b  |  11 lines

  1. /*
  2. **  Challenge: Write the smallest self-duplicating program, not
  3. **  reading the source file, which successfully exits and is strictly
  4. **  conforming Standard C.
  5. **
  6. **  Public domain response by Thad Smith
  7. */
  8.  
  9. #include<stdio.h>
  10. main(){char*c="\\\"#include<stdio.h>%cmain(){char*c=%c%c%c%.102s%cn%c;printf(c+2,c[102],c[1],*c,*c,c,*c,c[1]);exit(0);}\n";printf(c+2,c[102],c[1],*c,*c,c,*c,c[1]);exit(0);}
  11.