How can I set each character in a string to an integer? This is just the first thing I have to do in order to write a hash function. I have to set each character in a string to an integer so that I can sum their values. Please help! It it something like this??
int hashCode(string s)
{
int Sum = 0;
for(int i=0; i<strlen(s); i++)
{
Sum += (int)s[i];
}
return Sum;
}