Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

unordered_map c++

#include <iostream>
#include <unordered_map>
using namespace std;
int main()
{
    unordered_map<string, int> umap;
    // inserting values by using [] operator
    umap["GeeksforGeeks"] = 10;
    umap["Practice"] = 20;
    umap["Contribute"] = 30;
    // Traversing an unordered map
    for (auto x : umap)
      cout << x.first << " " << x.second << endl;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
4+1 =