| 2 | #include<bits/stdc++.h>> |
| 3 | using namespace std; |
| 4 | int main() { |
| 5 | |
| 6 | //Map: Commom use- counts frequency of various objects |
| 7 | //Maps are special arrays in which the indices(keys) of elements can be negative or very big or even strings! |
| 8 | |
| 9 | // map<key_datatype, value_datatype> m; |
| 10 | |
| 11 | map<string, int>m; //defines a map in which the keys of elements are strings. |
| 12 | m["hello"]=50; |
| 13 | m["world"]=12; |
| 14 | cout<<m["hello"]<<" "<<m["world"]; //50 12 |
| 15 | |
| 16 | //Maps are very similar to sets, in sets the values are unique and sorted. In maps, the keys are unique and sorted(lexicographically). |
| 17 | return 0; |
| 18 | } |
| 19 | ``` |
nothing calls this directly
no outgoing calls
no test coverage detected