This program work,
It reads a big log file line by line , After reading 3 lines , it shows segmentation fault .
int main(int argc, char *argv[])
{
char *line;
FILE *my_stream;
char *my_filename = "log";
my_stream = fopen (my_filename, "r");
while(fscanf (my_stream, "%s", &line)!= EOF)
{
printf ("==> %s\n", &line);
}
fclose (my_stream);
return 0;
}
OUTPUT
==> 123 ==> 12345 ==> 1234568 Segmentation fault