I'm stuck on the speller assignment but it feels like the smallest thing to be stuck on....in my hash function I keep getting "use of undeclared identifier" for n and i. Usually if this happens my curly braces are wrong, but I've been looking at this for a few hours now and I genuinely don't know what's wrong. I've also seen 3 other people use this same hash function and my code looks the same as their hash function, so I don't think it's that?
Here's just the hash function itself:
// Hashes word to a number
unsigned int hash(const char *word)
{
unsigned int hash_value = 0;
for (int i = 0; n = strlen(word); i < n; i++)
//citation: hash function from Shrey Tripathi on Stackexchange.com
{
hash_value = (hash_value << 2) ^ word[i];
}
return hash_value % HASHTABLE_SIZE;
}
Here is my entire code - I recognize that not all of it is 100% correct, I haven't had a chance to check all of it because it won't compile due to my hash function errors.
[EDIT: Code unrelated to question was removed.]