Problems with using a Long as a loop index
You know, you post code thinking that people will read it and try to understand what it means. Not copy and paste verbatim.
I think your problem might be here -->
if((model=fopen(path,"r"))==NULL)
If this is Windows you should (from memory) be using 'rb' because you are binary encoding the value. This should be for both the read and the write. Windows c-style file stuff behaves differently to linux/unix on this.
<edit - snip>
learn to use cout or the debugger to make sure values are what you expect
if((model=fopen(path,"r"))==NULL)
If this is Windows you should (from memory) be using 'rb' because you are binary encoding the value. This should be for both the read and the write. Windows c-style file stuff behaves differently to linux/unix on this.
<edit - snip>
learn to use cout or the debugger to make sure values are what you expect
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement