I can't make map
work with a class, what's wrong here? I can't figure it out, please help:
#include <map>
#include <iterator>
class base {
public:
bool delete_lowest(map<char, double> &frequencies)
{
double min=1; char del ; box b1;
for (iterator itr = frequencies.begin(); itr != frequencies.end(); ++itr)
{
if(itr->second < min)
{
min= itr->second ;
del= itr->first ;
}
}
frequencies.erase(del) ;
return true;
}
I am getting errors like "map is not declared" and so on. I think the way I code is not the proper way. so how do I proceed? Thanks