std 3a 3amap get all keys

Solutions on MaxInterview for std 3a 3amap get all keys by the best coders in the world

showing results for - "std 3a 3amap get all keys"
Elif
01 Apr 2017
1std::map<int, int> m;
2std::vector<int> key, value;
3for(std::map<int,int>::iterator it = m.begin(); it != m.end(); ++it) {
4  key.push_back(it->first);
5  value.push_back(it->second);
6  std::cout << "Key: " << it->first << std::endl();
7  std::cout << "Value: " << it->second << std::endl();
8}
9