testList - mylist.reverse();...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "List.h" #include <iostream> using namespace std; int main() { List<int> mylist; // create a list //add a few elements and keep drawing it mylist.draw("list", 0, true); mylist.push_back(5); mylist.draw("list", 0, true); mylist.push_back(10); mylist.draw("list", 0, true); mylist.push_back(100); mylist.draw("list", 0, true); mylist.push_front(11); mylist.draw("list", 0, true);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mylist.reverse(); mylist.draw(&quot;list&quot;, 0, true); //test the iterator code //Note: we need the begin and end functions for this one! // List&lt;int&gt;::iterator iter = mylist.begin(); // mylist.draw(&quot;list&quot;, &amp;iter, true); // while (iter != mylist.end()) { // ++iter; // mylist.draw(&quot;list&quot;, &amp;iter, true); // } }...
View Full Document

Ask a homework question - tutors are online