Create a Struct:
Then, when you save:Code:struct MAP { char MapName[64]; //64 char max map name int map[MAX_XTILES][MAX_YTILES]; // map };
That will load both the map name, and data in one call.Code://where someMap is of struct MAP fwrite(&someMap, sizeof(MAP), 1, f); and to open fread(&someMap, sizeof(MAP), 1, f);
Z.




Reply With Quote