I\'m trying to learn C++ so forgive me if this question demonstrates a lack of basic knowledge, you see, the fact is, I have a lack of basic knowledge.
I want some h
The solution to your problem is not the creation of your own iterators, but the use of existing STL containers and iterators. Store the points in each shape in a container like vector.
class Shape {
private:
vector points;
What you do from then on depends on your design. The best approach is to iterate through points in methods inside Shape.
for (vector ::iterator i = points.begin(); i != points.end(); ++i)
/* ... */
If you need to access points outside Shape (this could be a mark of a deficient design) you can create in Shape methods that will return the iterator access functions for points (in that case also create a public typedef for the points container). Look at the answer by Konrad Rudolph for details of this approach.