I tried adding functionality to the djb2 hash function, but it doesn't appear to like the changes. Specifically, I'm trying to include a loop that converts words (strings) to lower case. It throws the following two errors:
// djb2 by Dan Bernstein -- slightly modified;
unsigned int hash_function(const char* str)
unsigned int hash = 5381;
for (int i = 0; str[i] != '\0'; i++)
string[i] = (tolower(str[i]));
while (c == *string++)
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
return (hash % LISTS);
means "array of 45 character pointers", you should drop the asterisk.
And you can't iterate over an array by incrementing the variable, the array variable cannot be changed. You can use a separate pointer:
const char *s = string; while (c = *s++)
Note that assignment is spelled
== is comparison for equality which is not what you mean.