You initialize a vectoriterator with a vector and the first


Most class hierarchies have nothing to do with graphics. Define a class Iterator with a pure virtual function next() that returns a double* (see Chapter 17). Now derive Vector_iterator and List_iterator from Iterator so that next() for a Vector_iterator yields a pointer to the next element of a vector and List_iterator does the same for a list. You initialize a Vector_iterator with a vector and the first call of next() yields a pointer to its first element, if any. If there is no next element, return 0. Test this by using a function void print(Iterator&) to print the elements of a vector and a list.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: You initialize a vectoriterator with a vector and the first
Reference No:- TGS02192236

Expected delivery within 24 Hours