Ok.. i took a look, and its a little tought to tell where stuff is (esp. in the header file).
1) It looks like you are actually defining the MapIcon class within the Map class... if this is correct, then move the MapIcon definition to outside (above) the Map class definition.
Like:
Code:
class MapIcon
{
<stuff>
};
class Map
{
<stuff>
};
2) In the constructor of Map (I am assuming that is where the first part of the .cpp diff is?) You have a LOCAL variable called Icons (an array of 8 MapIcon objects). This LOCAL variable overrides your CLASS variable (the one defined in the header file). So, in the constructor, you are loading 8 icons, then destroying them as they go out of scope when you exit the constructor (because they are LOCAL variables). Nowhere in the constructor are you changing the CLASS variable called Icons.
3) The CLASS variable Icons needs to be your array of 8. (or however many). Like this:
Code:
class Map
{
<stuff>
MapIcon Icons[8];
<stuff>
};
4) The way you are reading the icons is extremely inefficient. You are opening the file 8 times, and skipping forward over each one you have already read. Try something like this (this is psuedo-code):
Code:
open(file)
for (int section = 0; section < 8; section++)
{
//skip to valid front of section
read data into Icons[section];
}
close(file)
Thats all I see for now.
You keep talking about 2 dimensional arrays and classes in your posts, and I'm not entirely sure what you mean... 2 dimensional arrays are completely differnet things from classes! A class is made up of a set of member variables, and a set of methods. arrays can contain classes, and classes can contain arrays, but they arent even close to the same thing.
--Jeeves