le principle est le meme non?
ou montre un bout de code pour comprendre?
int hashfind(char *cacher,char *mot) {
for(i=0;i<strlen(cacher);i++ ) {
if(mot[0]==cacher[i]) { // 'm'
if(mot[1]==cacher[i+1] {// 'o'
if(mot[2]==cacher[i+2]) { // 'i' trouver mon mot
ou=i;
break;
}
}}//if
} //for
return i;
}
structHashTable{
char *table;// Pointeur sur la table allouée
};
HashTable pin;
int hashfind(&pin,"moi");
int hashfind(HashTable cacher,char *mot) {
for(i=0;i<strlen(cacher->table);i++ ) {
if(mot[0]==cacher->table[i]) { // 'm'
if(mot[1]==cacher->table[i+1] {// 'o'
if(mot[2]==cacher->table[i+2]) { // 'i' trouver mon mot
ou=i;
break;
}
}}//if
} //for
return i;
}