I've got an array of pointers to my class "Rule" Now I'm trying to access it from within a member function AddRule. But on the first line I keep getting "Memory Access Violation"
Can anyone tell what's wrong?
class RuleSet
{
private:
public:
Rule *Rules[200];
int RuleNum;
void AddRule(Rule);
void ProcessCell(int);
RuleSet();
};
void RuleSet::AddRule(Rule A)
{
Rules[RuleNum]->min.MembraneOut[0]=A.min.MembraneOut[0]; // !!! THE BAD LINE
RuleNum++;
}
RuleSet::RuleSet()
{
this->RuleNum=0;
int i;
for (i=0;i<200;i++)
{
Rules[i]=new(Rule);
}
};