Can someone please give me an example of how to use .find() with a hashmap?
This is what I have:
(wordData is a struct with info about each word, and hashFunc is the name of the hash function)
typedef hash_map<string,wordData,hashFunc> wordHash;
wordHash hashofwords;
(after passing in a string s to a function)
hash_map<string, wordData>::iterator it;
it = hashofwords.find(s);
if(it != hashofwords.end()){
//do whatever
}
I know something is wrong in my thinking but I'm not sure what it is.