Can I use hash_multiset for storing string values and then searching if the value of another string exists in my set? Below is my program. I am populating hash_multiset with string "mango", "guao". Then when I use find or count on "mango" it is not finding it.
hms1_RcIter = hms1.find("mango");
if ( hms1_RcIter != hms1.end( ) )
cout << "The element of hash_multiset hms1 with a key of mango is: "
<< *hms1_RcIter << "." << endl;
else
cout << "The hash_multiset hms1 doesn't have an element "
<< "with a key of mango." << endl;
return 0;
}
OUTPUT:
mango guao Size is 2
Count is 0
The hash_multiset hms1 doesn't have an element with a key of mango.