How to make a Copy of a Queue

I was hoping you guys can help me in my specific case on copying of a Queue. I'm suppose to make a copy of the Queue inside ShowPassenger Function. I'm not exactly sure how to do it. So far,my Queue works successfully, only thing left is making a copy of the Queue. So when I dequeue to display each name in the Queue they don't disappear forever. So when I add more names onto the Queue the previous names displayed are there.



Last edited on
From design standpoint, why should you deque and remove the item, make a copy, in showPassengers()? Shouldnt you only display the names and not meddle with the queue itself ?

You can simply overload operator << and do cout <<queue ; to diplay all items ?
Thanks for the reply SreeB.
I was able to get it done, but I did not overload the operator but I did do something similar to it. By creating two Class objects and equaling them to the my BOOKED/WAITING list. That way, the original list isn't getting dequeue.
Last edited on
Topic archived. No new replies allowed.