previous | start | next

## Implementing Linked Lists (Implementing Iterators)

- The get function simply returns the data value of the node to which position points.

  >     string Iterator::get() const
  >     {
  >        assert(position != NULL);
  >        return position->data;
  >     }

- The equals function compares two position pointers.

  >     bool Iterator::equals(Iterator b) const
  >     {
  >        return position == b.position;
  >     }

previous | start | next