Thread: removing item from queue then viewing it?

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    30

    removing item from queue then viewing it?

    i have created a queue of stacks. i am supposed to remove the first item from my queue (which is a stack of two words) and then view the top word of the stack i just removed. i know that i can say myqueue.front.top() to look at the word BEFORE i remove it...but how do i view the item after i remove it??

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    When you remove an item from the queue, it is handed to you on a silver platter; all you have to do is not drop it.

    Code:
    item_I_want_to_look_at = myqueue.pop();

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 12:52 PM
  3. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM