programming-examples/c/Structures_and_unions/write a c program which produces its own source code as its output.c
2019-11-15 12:59:38 +01:00

15 lines
271 B
C

#include<stdio.h>
int main(){
FILE *fp;
char c;
fp = fopen(__FILE__,"r");
do{
c= getc(fp);
putchar(c);
}
while(c!=EOF);
fclose(fp);
return 0;
}