C++ Map
A map is an associate container for storing unique key-value pairs.
key: The key data type to be stored in the map.
type: The data type of value to be stored in the map.
compare: A comparison class that takes two arguments of the same type bool and returns a value.
Syntax:
template < class Key, class T, class Compare = less<Key>, class Alloc = allocator<pair <const Key,T> > > class map;
Example:
#include <string.h> #include <iostream> #include <map> #include <utility>
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.