queue concatenation

This is a discussion on queue concatenation within the C++ Programming forums, part of the General Programming Boards category; I'm using a circular-array queue template as following: template< class type> class Queue { public: Queue(); ~Queue(); T enQueue(T x); ...

  1. #1
    Unregistered
    Guest

    Red face queue concatenation

    I'm using a circular-array queue template as following:

    template< class type>
    class Queue {

    public:
    Queue();
    ~Queue();
    T enQueue(T x);
    T deQueue();
    bool isEmpty();
    bool isFull();
    void printQueue();

    protected:
    int front;
    int back;
    int items[maxSize]; //maxSize defined in main.cpp int length; //keep track of the # of elements
    };

    I was able to concatenate 2 queues without overloading += operator (have q1 called concatenation function, e.x. q1.concat(q2) ).


    I want to learn how to do it by overloading the operator. Appreciate your help...

  2. #2
    Unregistered
    Guest
    Sorry, missed

    int numEle (in protected)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Fixing my program
    By Mcwaffle in forum C Programming
    Replies: 5
    Last Post: 11-05-2008, 02:55 AM
  3. help with queues
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 05-21-2002, 09:09 PM
  4. help with queues
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 05-21-2002, 11:39 AM
  5. queue help
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 10-29-2001, 08:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21