Ok i've got some problem.I have function that saves array of class objects to a file using write function from fstream.h
Now i want to read from that file but not the whole 100x100 array but only an smaller one let say 20 on 20 such that it would be elements from squer map to map .
void Newmap(char file)
class Mapsqr Map;
fout.write((char*) &Map,sizeof Map);
if i make it like this
then tmpmap will be element that was in map but at tmpmap i will have element that was map not map.
void Readmap(char file)
class Mapsqr tmpmap;
fin.read((char*) &tmpmap,sizeof tmpmap);
so how to make it such way that tmpmap will have same data as map? How to tell program from where to read. Do i have to do such thing to get map element or is there some way to tell program where to begin to read?
void Readelementmap(char file)
class Mapsqr tmp;
for (int i=0;i<67;i++)
fin.read((char*) &tmp,sizeof tmp);