C-FAQ #1203
Avinash Narwekar
03:20s800 comment
STDIO I'm reading lines from a file into an array; but all the lines end up containing copies of the last line : char buf[80]; char * line[100]; int i; char *p; for(i = 0;i < 100;++i) { p = fgets (buf,80,fp); if (p == NULL) break; line[i] = p; }
Link
Social
Embed code