c - How do I check if the line is over? -
i ran problem today. can't find way check if line in file on , words read next 1 already. read word word file using fscanf, process word need , print out file there problem.
for example data file is:
hello, how doing?
and result file shows:
hello, how doing?
but need words in same lines took them. please keep in mind need words 1 one, why don't use getline()
here code of how read words file:
while( fscanf(file, "%s", a) != eof ) { check(a, b, &a); // edit words , put them in b string // printed write file }
thank tips!
read line string getline()
or fgets()
, use sscanf
words out of string.
Comments
Post a Comment