#include #include #include "queue.h" using namespace std; int main() { // create a queue Queue q; // test basic push/pop q.PushBack("alice"); q.PushBack("bob"); q.PushBack("cat"); cout << q.Length() << endl; // 3 while (!q.Empty()) { cout << q.PopFront() << " "; // alice bob cat } cout << endl; // test wraparound q.PushBack("alice"); q.PushBack("bob"); q.PushBack("cat"); q.PopFront(); // remove alice q.PopFront(); // remove bob q.PushBack("delia"); q.PushBack("evander"); q.PushBack("frankenstein"); cout << q.Length() << endl; // 4 while (!q.Empty()) { cout << q.PopFront() << " "; // cat ... frankenstein } cout << endl; // Note: this queue has a bug! If fails when the queue // is full (which you only notice if you test for that // case). I'm leaving it as-is as a debugging example. system("pause"); return 0; }