I am trying to use a list with a hash table to find an occurrence of a word and delete it from the table. The hashtable list is initilized as list<string>::hashTable[HASH_TABLE_SIZE] in a header file where the HASH_TABLE_SIZE is inputted by the user. In the code below I am attempting to iterate through the list and then delete the first occurence of a word... any ideas I currently get an infinite loop?
for(list<string>::iterator i = Hash::hashTable[0].begin(); i!=Hash::hashTable[HASH_TABLE_SIZE].end(); i++)
{
int count=0;
count=count+1;
cout<<count;
}*/
¿do you have a connection between the end of each list and the beginning of the next one? (for example, from hashTable[0].end() to hashTable[1].begin())
nevermind that Hash::hashTable[HASH_TABLE_SIZE].end() is invalid as you are trying to access past the end of the array.
> list<string>::hashTable[HASH_TABLE_SIZE]
weird syntax, ¿is `hashTable' a static member of your own list class?
> in a header file where the HASH_TABLE_SIZE is inputted by the user.
¿?