use "wb" and "rb" for writing and reading in data files
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
For me the question would be why would you use fscanf() to read a single character when fgetc() does it much more efficiently?
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
Question Answered as of 1 Year Ago by
WaltP
and
zeroliken Thank You WaltP for pointing me to fgetc()
You're welcome....
I was looking through the MAN pages and was able to fix my problem by using ftell() to see if the offset stopped changing after each read as follows:
Terrible idea. Why not just test the return of fgetc() and process the error or EOF?
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37