programming-examples/c/Structures_and_unions/write a c program which produces its own source code as its output.c

15 lines
271 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
#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;
}