Advertisement
Advertisement
| 06.29.2008 at 12:21PM PDT, ID: 23525262 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: |
#include <iostream>
#include <queue>
using namespace std;
int main()
{
queue<int> intQueue;
intQueue.push(10);
intQueue.push(20);
intQueue.push(30);
intQueue.push(40);
intQueue.push(50);
intQueue.push(60);
cout << "The front of the queue: " << intQueue.front() << endl;
cout << "\nThe last of the queue: " << intQueue.back() << endl;
intQueue.pop();
cout << "\nAfter removing from the queue the front of the queue is now: " << intQueue.front() << endl;
cout << "\nThe queue now has these in it: " << endl;
while(!intQueue.empty())
{
cout << intQueue.front() << " ";
intQueue.pop();
}
cout << endl;
cout << intQueue.front();
return 0;
}
|