Mail Archives: djgpp/2000/04/02/11:31:21
On Thu, 30 Mar 2000, beyonddeath wrote:
> I am using some code that will work somtimes less times than not,
> anyway when it does chances are you cant continue in the game anyway,
> the problem is that you save or load and dos gives you a big error
> that just says invalid page fault and a lotta numbers.
The DJGPP FAQ explains in sections 9.3 and 12.2 how to make sense out
of these lotta numbers.
> void dosave()
> {
> fptr = fopen("save.dat", "w+");
> fseek(fptr, 0L, SEEK_SET);
> fwrite(&player , sizeof(player), 1, fptr);
> fwrite(&days, size2, 1,fptr);
Here's your problem: you are writing binary information into the file,
but you didn't open the file in binary mode. See section 9.4 of the
FAQ for more details.
- Raw text -