Array of Pointers to Objects in a Class

Hi All,

I'm trying to make an array of pointers that point to an object class that I've created in another class. More specifically, I have a class "SkipList" in which I want an array of pointers to an object of class "Rectangle".

Here's a snippet of code that I have:

rectangle.h
1
2
3
4
5
6
7
8
9
10
11
class Rectangle {
	public:
		Rectangle(char* name, int x, int y, int w, int h);    
		~Rectangle();
		char *name;
		int x;
		int y;
		int w;
		int h;
		Rectangle *forward[10];
};


skiplist.h
1
2
3
4
5
6
7
8
9
10
11
12
class SkipList {
	public:
		SkipList();
        	~SkipList();
		void insert(char* name, int x, int y, int w, int h);    
		void remove(char* name);
		void remove(int x, int y, int w, int h);
		void rangesearch(int x, int y, int w, int h);
		void allintersections();
		void search(char* name);
		Rectangle *header[10];
};


When I try to compile it, it didn't like the array of pointers in "skiplist.h" and gave me the following errors:

skiplist.h(11) : error C2143: syntax error : missing ';' before '*'
skiplist.h(11) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Yes, this is an assignment that I am working on, any help/hints would be greatly appreciated. Thanks!
Solved. I had to add

 
#include"rectangle.h" 


in skiplist.h
Topic archived. No new replies allowed.