The STL map class template is an example of an associative container. The map template associates, or maps, values of some key type to values of some other type. For example, it is possible to use a map to associate names represented as strings with some other type that you chose, such as floating-point values. This would allow you to associate a person's name with a bank account balance, grade point average, etc. Associative containers similar to maps are often referred to as associative arrays in other programming languages.
Traditional arrays allow access to elements by their position in the array.
To declare an instance of a map, you must pass the key type and the value type as template parameters. The following is an example declaration of a map that associates strings with doubles. That Simple You must be careful when using a map as an associative array. Search the map for key. If key is found, return a reference to the value object associated with key.