?
What will be the output of the following C++ code?
What will be the output of the following C++ code?
#include <iostream>
#include <iterator>
#include <vector>
using namespace std;
int main ()
{
vector<int> myvector;
for (int i = 0; i < 10; i++)
myvector.push_back(i);
typedef vector<int> :: iterator iter_int;
reverse_iterator<iter_int> rev_iterator;
rev_iterator = myvector.rend() - 4;
cout << *rev_iterator << endl;
return 0;
}
#include <iostream>
#include <iterator>
#include <vector>
using namespace std;
int main ()
{
vector<int> myvector;
for (int i = 0; i < 10; i++)
myvector.push_back(i);
typedef vector<int> :: iterator iter_int;
reverse_iterator<iter_int> rev_iterator;
rev_iterator = myvector.rend() - 4;
cout << *rev_iterator << endl;
return 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login