I have a class named Person, which contains of a header and a cpp files. I tried to declare a static list in the header file, like this:
static list<Person*> group;
( I already included list in both the cpp and the header file). I've tried to write a Print function in the cpp file:
void Person::PrintAll() const {
int counter=0;
list<Person>::iterator i;
**for ( i= group.begin(); i != group.end(); ++i)**{
cout << *i << endl;
counter++;
}
But I get lots of errors in the "for" line ( the one which is marked). I also tried to declare the static list in the cpp file, but I get the same error. What do I do wrong? Thanksalot