Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <vector>
- int main()
- {
- using namespace std;
- map<vector<int>, string> dictionary;
- vector<int>* vector1 = new vector<int>{ 1, 2, 3 };
- dictionary.insert(pair<vector<int>, string>(*vector1, "vector1"));
- vector1->push_back(4);
- dictionary.insert(pair<vector<int>, string>(*vector1, "vector2"));
- map<vector<int>, string>::iterator it = dictionary.begin();
- for (it = dictionary.begin(); it != dictionary.end(); ++it)
- {
- cout << " value " << it->second << '\n';
- }
- delete vector1;
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment