![]() |
In C++, maps are associative containers that store elements in a mapped fashion. Each element has a key value and a mapped value. No two mapped values can have the same key values. In this article, we will learn how to declare a map in C++. How to declare a map in C++?In C++, you can declare a map using the Syntax to declare a map in C++ STLstd::map<KeyType, ValueType> mapName;
where,
C++ Program to Declare a MapC++
Output
Key: one, Value: 1 Key: three, Value: 3 Key: two, Value: 2 |
Reffered: https://www.geeksforgeeks.org
C++ |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |