P
PX
Greetings,
Say I want to read a file line by line so I used fgets(). And I want
to parse strings from each line of the file, I used sscanf(). But
there's a strange problem that each time I run the program, sscanf()
cannot read in first line of file correctly. It always appends a
character at the end of last string that's been parsed. I am working
on HP-UX using cc. Anybody has any clue?
Thanks a bunch!
Say I want to read a file line by line so I used fgets(). And I want
to parse strings from each line of the file, I used sscanf(). But
there's a strange problem that each time I run the program, sscanf()
cannot read in first line of file correctly. It always appends a
character at the end of last string that's been parsed. I am working
on HP-UX using cc. Anybody has any clue?
Thanks a bunch!