Your code should do something like this. This code isn't going to win any prizes for style, I'm just trying to show you what is required
Queue operator+(Queue &obj){
Queue res;
res.size = size + obj.size; // work out the new queues size
res.queue = new int[100]; // allocate memory for new queue
for (int i = 0; i < size; ++i) // copy from first queue to new queue
res.queue[i] = queue[i];
for (int i = 0; i < obj.size; ++i) // copy from second queue to new queue
res.queue[size + i] = obj.queue[i];
return res;
}
As I said there are all sorts of things wrong with this code, and with the other code you have written. But it will hopefully give you some idea of what you need to do.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…