Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. typedef vector<int>::iterator Itv;
  2. vector<int> vec = {1,2,3,4,5,6,7,8,9};
  3.  
  4. Itv ev = vec.begin();
  5. ++ev;
  6. ++ev;
  7. ++ev;
  8. for (Itv it = vec.begin(); it != ev; ++it){
  9. cout << *it;
  10. }
  11.  
  12. //data.txt contains: 1,2,3,4,5,6,7,8,9
  13. typedef istream_iterator<char> Itf;
  14. fstream file("data.txt");
  15. Itf ef(file);
  16. ++ef;
  17. ++ef;
  18. ++ef;
  19. for (Itf it(file); it != ef; ++it){
  20. cout << *it;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement