Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::map is an STL container for mapping two kinds of data types.
#include <iostream> |
The std::string is the key (in this case a last name) and the int is termed the value (in this calse the persons telephone number).
One key can only have one value. If a key needs to have one or more values, use a std::multimap.
Note that among these are also more general container code snippets.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.