Queue of string: push(), empty(), front(), pop() : queue « Queue Stack « C++






Queue of string: push(), empty(), front(), pop()

   
#include <iostream>
#include <string>
#include <queue>
using namespace std;

int main()
{
    queue<string> q;

    q.push( "A" );
    q.push( "B" );
    q.push( "C" );

    while ( !q.empty() ) {
        cout << q.front() << " ";
        q.pop();
     }

     return 0;
}
  
    
    
  








Related examples in the same category

1.queue with doubles
2.queue: push, pop, front and size
3.queue.front()
4.Queue: push, pop and size
5.Put string into a queue