Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- #include <string>
- using namespace std;
- int main ()
- {
- queue <string> names; /* Declare a queue */
- names.push ("Ben"); /* Add some values to the queue */
- names.push ("Erin");
- names.push ("Dan");
- cout << names.size ()<<" names added" << endl;
- cout << "Now serving: "
- << names.front () << endl << endl;
- names.pop ();
- cout << "There are currently " << names.size ()
- << " people in the queue. "
- << "\nThe next person in the queue is "
- << names.front () << "." << endl << endl
- << names.back () << " is the last person in the queue."
- << endl;
- cin.get ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement