créer un tableau à partir d'une table de hachage
bonjour à tous,
j'ai un mot de type Chainon mot
Code:
1 2 3 4 5 6 7 8
| typedef struct st_chainonMot ChainonMot;
typedef struct st_liste
{
ChainonMot *pPremier;
} ListeMot;
typedef ListeMot TableHachageMot[TAILLEHASH]; |
ce mot contient une liste des coordonnées (numeros le lignes où il apparait)
Code:
1 2 3 4 5 6
| typedef struct st_chainonCoord ChainonCoord;
typedef struct st_listeCoord
{
ChainonCoord *pPremiere;
} ListeCoord; |
Mon probleme c'est que j'aime créer un tableau de MotCompact à partir d'une table de hachage
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| int * CreerTableauLigne(ChainonMot const*pc,size_t taille)
{
ChainonCoord const *pcCoord;
int * tableauLigne=malloc(taille*sizeof(int));
if(tableauLigne!=NULL)
{
size_t i=0;
int annex=-1;
for(pcCoord=coord_GetPremierC(GetPtrCoordC(pc));pcCoord!=NULL;pcCoord=ptr_GetNextC(pc))
{
if(GetLigne(pc)!=annex)
{
tableauLigne[i]=GetLigne(pcCoord);
annex=GetLigne(pcCoord);
i++;
}
}
}
} |
Code:
1 2 3 4 5 6 7
| MotCompact* InitialiserMotCompact(ChainonMot* p,size_t taille)
{
MotCompact* MC;
MC->sczMot=GetMot(p);
MC->pLignes=CreerTableauLigne(p,taille);
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| MotCompact* CreerTableMotsCompacts(size_t n,TableHachageMot *DblTableHash1fr)
{
MotCompact *pRet=malloc( TAILLEHASH * TAILLEHASH *sizeof(MotCompact));
int i=0,j,k;
if(pRet!=NULL)
{
for(j=0;j<TAILLEHASH;j++)
{
for(k=0;k<TAILLEHASH;k++)
{
pRet[i]=InitialiserMotCompact(DblTableHash1fr[j][k],n);
i++;
}
}
}
return pRet;
} |
dans la ligne en gras ya 2erreurs:
erreur: incompatible type for argument 1 of ‘InitialiserMotCompact’|
erreur: incompatible types in assignment|
des idées svp?
merci