mcbryan (11/08/82)
_______________________________________________________________________________
#
/*
* Self-Reproduction in C:
*
* This is a complete self-reproducing C program. To compile
* and run, place text between the scored lines in a file, say junk.c,
* and type:
* cc junk.c -o junk
* junk
*
* Features:
* 1. Well-documented
* 2. Uses only fopen(), getc() and putc().
* 3. Looks very clean.
*
* Oliver A. McBryan
* New York University.
*/
#include <stdio.h>
main()
{
FILE *file = fopen(__FILE__,"r");
int c;
while ((c=getc(file))!=EOF) putc(c,stdout);
}
______________________________________________________________________________