?
What will be the output of the following C++ code?
What will be the output of the following C++ code?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
unsigned int i;
deque<int> mydeque;
deque<int> :: iterator it;
mydeque.push_back ( 100 );
mydeque.push_back ( 200 );
mydeque.push_back ( 300 );
for (it = mydeque.begin(); it != mydeque.end(); ++it)
mydeque.clear();
cout << ' ' << *it;
}
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
unsigned int i;
deque<int> mydeque;
deque<int> :: iterator it;
mydeque.push_back ( 100 );
mydeque.push_back ( 200 );
mydeque.push_back ( 300 );
for (it = mydeque.begin(); it != mydeque.end(); ++it)
mydeque.clear();
cout << ' ' << *it;
}
Join the Discussion
Login to post a comment or share your explanation.
Login