Reading a file with fscanf()
I have used fgets as well as fscanf to read a file line by line but all the time I have got some wrong output.
开发者_开发问答1st line of the file contain 149 characters and 2nd line contains 122 characters, but in my output file it shows 1st line contain 149 but 2nd line contain 128.
By output file do you mean to say that you are reading from one file and writing it into another? Are you manipulating the string before writing it? If that is the case then maybe your manipulaion is repositioning the newline characther. Just a guess. We will need to see the code.
精彩评论