Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef vector<int>::iterator Itv;
- vector<int> vec = {1,2,3,4,5,6,7,8,9};
- Itv ev = vec.begin();
- ++ev;
- ++ev;
- ++ev;
- for (Itv it = vec.begin(); it != ev; ++it){
- cout << *it;
- }
- //data.txt contains: 1,2,3,4,5,6,7,8,9
- typedef istream_iterator<char> Itf;
- fstream file("data.txt");
- Itf ef(file);
- ++ef;
- ++ef;
- ++ef;
- for (Itf it(file); it != ef; ++it){
- cout << *it;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement