Queues

Ok so Im trying not to go into such detail because it would take for ever but I have a queue of class City and when I do dequeue/remove a object off of the queue but I wanna return the object in dequeue(), so I want to remove it but still keep it. How would I do that? Let me know if you need some more details. Thanks
Last edited on
Rather, I don't see the problem. Why don't you just do what you said?
lol Im just not sure how to do it. I'm not sure whether its cuz its late and im tired but what I was thinking. I know how to delete it but i guess im stuck on is how to keep it.
Before you remove the element, save it in a local variable and return it at the end.
Topic archived. No new replies allowed.