Wednesday, September 9, 2009

Write a C program which output is source code itself


C program to get source code of current program that is program itself



#include

void main()

{

FILE *p;

char ch;

clrscr();

p=fopen("raja.c","r");

while((ch=getc(p))!=-1)

putchar(ch);

fclose(p);

getch();

}

No comments:

Post a Comment