From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/CONTRIB/SNIP/ansiself.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 reference/C/CONTRIB/SNIP/ansiself.c (limited to 'reference/C/CONTRIB/SNIP/ansiself.c') diff --git a/reference/C/CONTRIB/SNIP/ansiself.c b/reference/C/CONTRIB/SNIP/ansiself.c new file mode 100755 index 0000000..863ee4e --- /dev/null +++ b/reference/C/CONTRIB/SNIP/ansiself.c @@ -0,0 +1,10 @@ +/* +** Challenge: Write the smallest self-duplicating program, not +** reading the source file, which successfully exits and is strictly +** conforming Standard C. +** +** Public domain response by Thad Smith +*/ + +#include +main(){char*c="\\\"#include%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);} -- cgit v1.2.3-54-g00ecf