How to access unordered_multimap

someone please help I want to access unordered_multimap how i can do this?

void fun(std::unordered_multimap <char,std::vector<char>> m,char x)

{

    for(auto y : m[x])  //ERROR can anyone give the alternative for accessing like this please..

    {

        if(m.find(y)==m.end())

        {
            cout<<y;
            break;
        }
 }
}
  • multimap doesn’t have subscript operator, so m[x] is not correct
  • do you really need a multimap? Possible characters are not to many, isn’t better to use an array?
  • what fun should do? return the second argument of m?
1 Like

Using it for calculating First of Any Grammar in compiler design

I have no idea what you are talking about, sorry. Could you explain in other words what you are expecting func to do?