I'm trying to read a line using the following code:
while(fscanf(f, "%[^
]s", cLine) != EOF )
{
/* do something with cLine */
}
But somehow I get only the first line every time. Is this a bad way to read a line? What should I fix to make it work as expected?
See Question&Answers more detail:os