Accessing Iterator as private member of a class
My question is how can I access an iterator that is a private member of a class?
I have tried the above, and several other ways and I keep getting a compilier error that ListIt is undeclared. Thanks.
friend ostream& operator<<(ostream& OUTPUT, const Sequence & s);
list <int> intList;
list <int> :: iterator ListIt;
ostream& operator<<(ostream& OUTPUT, const Sequence& s)
for(ListIt=s.intList.begin(); ListIt != intList.end(); ListIt++)
cout << *ListIt;