Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<vector>
- #include<iostream>
- using namespace std;
- int main() {
- vector<int> myvector(3, 100);
- vector<int>::iterator it;
- it = myvector.end();
- it = myvector.insert(it, 200);
- myvector.insert(it, 2, 300);
- it = myvector.end(); ////////// here is the point what i want to ask. ///////////
- std::vector<int> anothervector(2, 400);
- myvector.insert(it - 2, anothervector.begin(), anothervector.end());
- int myarray[] = { 501,502,503 };
- myvector.insert(myvector.begin(), myarray, myarray + 3);
- cout << "myvector contains:";
- for (it = myvector.begin(); it < myvector.end(); it++)
- cout << ' ' << *it;
- cout << 'n';
- return 0;
- }
- it = myvector.end();
Add Comment
Please, Sign In to add comment