Jump to content
  • Advertisement
Sign in to follow this  
Lindon Heaven

save code needs help

This topic is 5052 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!