|
ex5-9main.cpp - Example 5-9 Linked List - main Source file (ex5-9main.cpp) |
#include <iostream>
using namespace std;
#include "ex5-9list.h"
int main (void)
{
List L;
L.push(2);
L.push(4);
L.push(6);
L.push(8);
L.push(10);
L.print();
cout << "top=" << L.top() << endl;
if (L.find(2)) cout << 2 << " is in the list\n";
if (L.find(5)) cout << 5 << " is in the list\n";
if (L.find(6)) cout << 6 << " is in the list\n";
if (L.find(10)) cout << 10 << " is in the list\n";
L.remove(3);
L.remove(6);
L.print();
L.remove(2);
L.remove(10);
L.print();
return 0;
}
CIS27: Programming in C++ Instructor: Joe Bentley