I managed to correctly write my speller using a hashtable, however the speller function did not return the correct number of words in dictionary so I had to take another method, but the question remained: Why doesn't the speller function recognized the hashtable previously loaded with data from dictionary? Here is my code:
// Returns number of words in dictionary if loaded else 0 if not yet loaded
unsigned int size(void)
{
int count_words = 0;
for (int i = 0; i < N; i++)
{
while (hashtable[i] != NULL)
{
count_words++;
hashtable[i] = hashtable[i]->next;
}
}
return count_words;
}