View Single Post
Old Mar 22nd, 2008, 2:51 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Re: How to name queues using a "for" loop??

Are you creating the queue entirely yourself or can you use one that's been built for you?

If you're allowed to use a built-in library, try the queue class of the standard library. As you'll need five, make an array of five of them.
std::queue<queue type> q[5];

That should be all you need to create them. Obviously, you'll need to replace "queue type" with whatever type of variable you're storing in it. You can then use the push and pop methods to store and remove information. In addition, front will return the frontmost item in the queue.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote