C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/Indexing

From Wikibooks, open books for an open world
Jump to navigation Jump to search

A map can be indexed-by-key (a lookup operation). Use either the C-array-operator, the at() function, or the find() function. These differ in how they deal with a non-existent key.

Additional information about map indexing (includes interactive examples)