C++ Mania
Miscellaneous problems and features of C/C++
Thursday, December 30, 2010
Can you write a program which produces own source code as output ?
#include <stdio.h>
void main()
{
FILE *fd;
int c;
fd= fopen("./itself.c","r");
while ( (c=fgetc(fd)) != EOF)
{
printf("%c", c);
}
fclose(fd);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment