Facebook
From Ungracious Wigeon, 5 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 213
  1. #include <iostream>
  2. #include <string>
  3. #include <list>
  4. #include <iterator>
  5.  
  6. using namespace std;
  7.  
  8. void fun(list<string>::iterator it, list<string>::iterator it2)
  9. {
  10.     for(;it!=it2;it++)
  11.         cout<<*it<<endl;
  12. }
  13.  
  14. int main()
  15. {
  16.     list<string> l;
  17.     l.push_back("a");
  18.     l.push_back("b");
  19.     l.push_back("c");
  20.     l.push_back("d");
  21.     l.push_back("e");
  22.     l.push_back("f");
  23.     l.push_back("g");
  24.     l.push_back("h");
  25.  
  26.     fun(++l.begin(), --l.end());
  27.     return 0;
  28. }
  29.