//traditional way (long)
for(map::iterator it=m.begin(); it!=m.end(); ++it)
if(it->second)cout<first<<" ";
//easy way(short) just works with c++11 or later versions
for(auto &x:m)
if(x.second)cout<
c++ iterate map
// C++11 and onwards
for (auto const& keyValue : map)
{
keyValue.first; // Key
keyValue.second; // Value
}