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

save code needs help

This topic is 5481 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!