// clist-driver.cc // ConcordList class test #include #include "clist.h" void instructions(); main() { ConcordList clist; cout << "Testing a List of char * values" << endl; int choice; char value[25]; instructions(); do { cout << "? "; cin >> choice; switch (choice) { case 1: cout << "Enter a word: "; cin >> value; clist.insertAtFront(value); clist.print(); break; case 2: cout << "Enter a word: "; cin >> value; clist.insertAtBack(value); clist.print(); break; case 3: if (clist.removeFromFront()) cout << "Removed first element from list" << endl; clist.print(); break; case 4: if (clist.removeFromBack()) cout << value << "Removed last element from list" << endl; clist.print(); break; } } while (choice != 5); cout << "End test of word List" << endl; return 0; } void instructions() { cout << "Enter one of the following:" << endl << " 1 to insert at beginning of list" << endl << " 2 to insert at end of list" << endl << " 3 to delete from beginning of list" << endl << " 4 to delete from end of list" << endl << " 5 to end list processing" << endl; }