What will be printed out as a result of the following code execution?
#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
using namespace std;

int main() {
   list <int> coll;
   for(int i=1;i<=9;++i)
   {
      coll.push_back(i);
   }
   list<int>::iterator pos;
   pos=find(coll.begin(), coll.end(), 5);
   cout<< *pos <<' ';
   list<int>::reverse_iterator rpos(pos);
   cout<< *rpos <<' ';
   list<int>::iterator rrpos; 
   rrpos=rpos.base();
   cout<< *rrpos <<' ';
   return 0;
}
Explanation
Get an explanation when it's available:

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes