Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::multimap is an STL container similar to std::map, except that it can hold multiple values for one key.
#include <map> |
The std::string is the key (in this case a last name) and the int is termed the value (in this case the persons telephone numbers).
One key can only have no, one or many values, like a person can have no, one or many phone numbers.
To add a key-value-pair, use std::multimap<T>::insert. To find a range of values, use std::multimap<T>::equal_range. This member function returns a std::pair of iterators.
#include <iostream> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
This page has been created by the tool CodeToHtml