I am incredibly new to c# and am just learning to work with queues and stacks. I have created a simple queue of nintendo games and used the Enqueue and Dequeue for practice. How can I copy this queue into a stack?
I am incredibly new to c# and am just learning to work with queues and stacks. I have created a simple queue of nintendo games and used the Enqueue and Dequeue for practice. How can I copy this queue into a stack?
Last edited by rpmischris; 11-28-2012 at 08:55 PM.
Stack<T> contains a constructor that has an IEnumerable as a parameter. Just your luck, Queue<T> implements the IEnumerable interface.