Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <list>
- using namespace std;
- int main() {
- list<int> l1 = {1, 2, 3, 4, 5};
- // cout << l1.front() << endl;
- // cout << l1.back() << endl;
- list<int>::iterator it = l1.end();
- it--;
- it--;
- cout << *it << endl;
- list<int>::iterator it2 = l1.begin();
- it2 = next(it2, 2);
- cout << *it2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment