Sign in to follow this  

save code needs help

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

can you look at this code it for some reson wont save the value 26 ? int Map1,Map0; FILE *Save_Array; struct rec { int Layer_0;//,Layer_1,Layer_2; }; int Save_Array_File() { Save_Array=fopen("Save_File","w"); struct rec Map_Data; for ( Map0=0;Map0<200;Map0++) for ( Map1=0;Map1<10 ;Map1++) { Back_Up_Array[Map0][Map1] = Map_Array[Map0][Map1]; Map_Data.Layer_0 = Map_Array[Map0][Map1]; fwrite(&Map_Data,sizeof(struct rec),1,Save_Array); } fclose(Save_Array); return(1); } ///////////////////////////////////////////////////////////////// int Load_Array_File() { Save_Array = fopen("Save_File","r"); struct rec Map_Data; for ( Map0=0;Map0<200;Map0++) for ( Map1=0;Map1<10 ;Map1++) { fread(&Map_Data,sizeof(struct rec),1,Save_Array); Map_Array[Map0][Map1] = Map_Data.Layer_0; } fclose(Save_Array); return(1); }

Share this post


Link to post
Share on other sites

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this