I'm writing a program to create a hash table but the hash function keeps giving me back the same number no matter how i write it making every insert in the same bucket and extending the linked list. I can add more code if it helps but this is where i feel the error is.
Line 4: Every time you call your hash function, you're resetting the starting point of the RNG. srand should be called ONCE at the beginning of main. Do not call it repeatedly. http://www.cplusplus.com/reference/cstdlib/srand/
It's for a data structure class so we have to write each function for the hashtable but that is definitely a more efficient way of doing it. Thanks for the help though! And i thought the title was a better depiction of the content so i changed it from solved lol.