/* Filename: listtest.cpp Programmer: Br. David Carlson Date: October 10, 1997 Last Modified: December 2, 2001 This program is a test program for ListClass. It creates an empty list, tries out InsertFront, InsertRear, InsertInOrder, NumItems, RemoveFront, and Find. Tested with: Microsoft Visual C++ 6.0 Microsoft Visual C++ .NET g++ under Linux */ #include "list.h" int main(void) { ListClass ListA; float Result; ListA.InsertFront(4.5); ListA.InsertFront(-3.33); ListA.InsertRear(12.6); ListA.InsertInOrder(3.66); cout << "Number of items in ListA is " << ListA.NumItems() << endl; if (ListA.Find(3.66) == NULL) cout << "Could not find 3.66 in the list (incorrect)" << endl; else cout << "Found 3.66 in the list (correct)" << endl; Result = ListA.RemoveFront(); cout << "Removed from front of ListA " << Result << endl; // Destructor automatically called for a static object return 0; }