I have a class called Regions and another class I will call Area. In the main class Area, I need to have an array of Region class objects.
Here is my region class:
class Region
{
public:
// Constructor
Region();
// Get/set functions
bool getPoly() {return poly;}
bool setPoly(bool value) {poly = value;}
long getMesh() {return mesh;}
void setMesh(long value) {mesh = value;}
long getVisibleNum() {return visibleNum;}
void setVisibleNum(long value) {visibleNum = value;}
// Visibility vector
void reserveSpace();
long addVisibleRegion(int region);
long getSize(){return visibility.size();}
friend class Area;
private:
bool poly; // Does the region have polygons?
long mesh; // The reference to a 0x36 mesh
long visibleNum; // The number of visible regions
};
Now in my area class, I am trying to declare something like this :
class Area
{
public: // Some public class functions
private:
Region* regionArray; // this should be pointers to an array of class objects
}
In the Area class constructor, I will allocate the number of class objects I want.
I am getting this error:
error C2143: syntax error : missing ';' before '*'
error C4430: missing type specifier - int assumed.
Note: C++ does not support default-int
So I assume I am not setting it up correctly. It worked perfectly when Region was a struct but now that it is a class, I assume I am doing something wrong.