Grazie per la risposta, ti posto tutto.
Fammi sapere!
codice:
int hashFunction (const char* s, hashTable_t* ht){
int i=0,somma=0;
while(s[i]!='\0'){
somma=somma+s[i];
i++;
}
somma=somma%(ht->size);
if (i>MAXL) {fprintf(stderr,"Errore nel calcolo della hash function"); return -1;}
return somma;
}
int main (int argc,char * argv []){
hashTable_t * tabella=createHash (7);
hashElement_t * p1;
const char * test="pippare";
if ((p1=putHash(tabella,"rico",5))==NULL)printf ("inserimento non effettuato");
if ((p1=putHash(tabella,"volare",7))==NULL)printf ("inserimento non effettuato");
if ((p1=putHash(tabella,"pappare",8))==NULL)printf ("inserimento non effettuato");
if ((p1=putHash(tabella,"pippare",2))==NULL)printf ("inserimento non effettuato");
if ((p1=putHash(tabella,"parlate" ,51234))==NULL)printf ("inserimento non effettuato");
return 0;
}