0

hi, this is my hash function, could anyone explain to me why the lines in red are experiencing an "int cannot be deferenced"? Thank you.

public static int hashFunc3(int key) 
{
	int hashVal = 0;
 for (int j=0; j<key.length(); j++) //left to right 
	{
 int letter = key.charAt(j) - 96; //get char code
		hashVal = (hashVal * 27 + letter) % arraySize; //mod
	}
	return hashVal;  //no mod
} //end hashFunc3()

Edited by jemimaloh: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by jemimaloh
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.