Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
This program is just to illustrate a point, not to bother with exception handling.
Windows generates the exception.
Senior Member
Posts: 485
Threads: 54
Joined: 2008-09
I know, but the exception could happen if the fopen failed. Are you quite sure it succeeded?
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
Ah, I see what you're saying. My bad.
Yes, I'm 100% sure it succeeded. I use a function "safe_fopen" which always checks for NULL when opening a file.
Senior Member
Posts: 485
Threads: 54
Joined: 2008-09
Are the arguments to fread correct?
ISTR all the "f" family of functions having the FILE* as first argument, but I shamefully admit I have no C compiler on this, my mapling machine, so I can't make sure.
Junior Member
Posts: 48
Threads: 0
Joined: 2008-11
Gender: Male
Sexual Orientation: Gay
Country Flag: uk
IGN: Tempus
Server: eMS Kradia
Level: 12x
Job: I/L Mage
Guild: Solaris
Guild Alliance: Tonton
I can recreate the error, but only when fopen() fails. If the file exists and opens correctly, I don't get any runtime exception.