typedef (unspecified) deque<X, A>::iterator;
#include <deque>
#include <iostream>
#include <deque>
int main()
{
using namespace std;
// Create a deque and add four elements to it
deque<int> qDeque;
qDeque.push_back(5);
qDeque.push_back(101);
qDeque.push_back(-4);
qDeque.push_back(32);
// Use the iterator to access and output the elements
deque<int>::iterator qIter;
for (qIter = qDeque.begin(); qIter != qDeque.end(); ++qIter) {
cout << "Deque entry = " << *qIter << endl;
// Set the entry to 30 and output it again
*qIter = 30;
cout << "Deque entry after it is set = " << *qIter << endl;
}
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.