home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / snip1292.zip / ANSISELF.C < prev    next >
C/C++ Source or Header  |  1992-04-12  |  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.