// Use the Queue STL for a queue of any type // Here,I use an int queue and a double queue // Method 'push()' is used for the 'enqueue()' operation // Method 'front()' is used to see the front queue element // Method 'pop()' removes the front element from the queue, dequeue() #include #include using namespace std; void main() { int array[] = { 3,5,4,6,7,8,12,45,63,48,77,83,}; queue q; for (int i = 0; i < sizeof(array)/sizeof(int); i++) q.push(array[i]); while ( ! q.empty() ) { cout << q.front() << endl; q.pop(); } cout << "--------------------\n--------------------\n"; double array2[] = { 2.1, 5.7, 3.7, 4.66, 2.09, 89.4, 65.1}; queue q2; for (i = 0; i < sizeof(array2)/sizeof(double); i++) q2.push(array2[i]); while ( ! q2.empty() ) { cout << q2.front() << endl; q2.pop(); } }