This is kind of a strange question but I'm not getting much useful info from the compiler and am wondering what I'm doing wrong.
I have a program (we'll just call it 'main') that includes a class 'world', which itself includes a class 'tile'. Everything is being included correctly as far as I can tell - I can add an instance of tile as a member of an instance of world and then (via public getter methods) access the data in the tile from main.
The problem occurs when I want to use a multi-dimensional array of tiles as a member of an instance of world - the compiler crashes with the helpful message "cc1plus.exe has stopped working" and the helpful text "[Build Error] [main.o] Error 1".
I have a parameterless default constructor defined for the tile class (and for the world class as well although I don't think that's relevant.) I'm not sure at all what else could cause this. Any insight would be really appreciated.
Ex: main.cpp
#include <world.h>
world newWorld;
int main(int argc, char *argv[]){
newWorld = world();
}
world.h
#include <tile.h>
class world {
tile wmap[100][100][10]
public:
world(){
//code that calls the parametized constructor for tile for each element in the array
}
};
tile.h
class tile {
int temp;
public:
tile(){}
tile(int t){temp = t;}
};
I apologize if the answer should be obvious, this is my first foray back into C++ in several years and it seems I've gotten sloppy.