开发者

Reading a file with fscanf()

开发者 https://www.devze.com 2023-02-08 01:30 出处:网络
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.开发者_开发问答

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号