home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / ANSISELF.C < prev    next >
C/C++ Source or Header  |  1997-07-05  |  457b  |  13 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. **  Challenge: Write the smallest self-duplicating program, not
  5. **  reading the source file, which successfully exits and is strictly
  6. **  conforming Standard C.
  7. **
  8. **  Public domain response by Thad Smith
  9. */
  10.  
  11. #include<stdio.h>
  12. 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);}
  13.