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...