Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

std::map get all keys

std::map<int, int> m;
std::vector<int> key, value;
for(std::map<int,int>::iterator it = m.begin(); it != m.end(); ++it) {
  key.push_back(it->first);
  value.push_back(it->second);
  std::cout << "Key: " << it->first << std::endl();
  std::cout << "Value: " << it->second << std::endl();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #keys
ADD COMMENT
Topic
Name
6+1 =