Check out example codes for "how to iterate through a map in c++". It will help you in understanding the concepts better.

Code Example 1

    for (auto i : m) 
        cout << i.first << "   " << i.second << endl;

Code Example 2

//traditional way (long)
for(map<string,int>::iterator it=m.begin(); it!=m.end(); ++it)
	if(it->second)cout<<it->first<<" ";
//easy way(short) just works with c++11 or later versions
for(auto &x:m)
	if(x.second)cout<<x.first<<" ";
//condition is just an example of use

Learn ReactJs, React Native from akashmittal.com