error :"'p' does not name a type

this is my header file but it gives me an error
'error: 'p' does not name a type'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class set
{
public:
       void Union (set,set);
       void intersection (set,set);
       void subtract (set,set);
       void delta (set,set);
       void numSet (int);
       void numClr (int);
       bool pGet (int);
private:
	bool *p;
	p = new bool [100]
};


what's wrong ?
Last edited on
p = new bool [100];

You can't allocate memory in the middle of a class definition. It makes no sense. That sort of thing happens when you actually create an instance of the class; for example, in the constructor.
Topic archived. No new replies allowed.