Posted by: prankster February 5, 2011
Login in to Rate this Post:
0
?
how abt something like below, havent compiled, dont have a compiler :)
This should return the sum of the ascii values.
int hash(char *name)
{
int sum = 0;
int i;
for (i = 0; i < strlen(name); i++)
{
sum = sum + name[i];
}
return sum;
}
This should return the sum of the ascii values.
int hash(char *name)
{
int sum = 0;
int i;
for (i = 0; i < strlen(name); i++)
{
sum = sum + name[i];
}
return sum;
}