Name:
Anonymous
2011-05-30 20:08
I decided to write a program that printed itself, and I couldn't.
I pose to you this challenge, /prog/
Name:
Anonymous
2011-05-31 1:43
#include <stdio.h>
#include <string.h>
int main(void)
{
FILE *prog = fopen("writemyself.c","r");
char *buffer = malloc(sizeof(char) * 30);
memset(buffer, '\0', sizeof(char) * 30);
while (fscanf(prog,"%s", buffer))
{
fprintf(stderr, "%s", buffer);
memset(buffer, '\0', sizeof(char) *30);
}
return 0;
}
Name:
Anonymous
2011-05-31 1:47
print open(__file__).read(),