Home > Back-end >  [for]
[for]

Time:10-11

Code target is to read the file content and to save the content in the array, the array output, why the results are well

CodePudding user response:

char * fileline [1024]. You want to define fileline such an array element is a char *

Followed by
Fileline [l]= (char *) malloc (strlen (buf));

CodePudding user response:

Then there is the fgets inside the loop, you can print f % s buf first, and see what the data is read