Bonsoir,
j'ai un probleme l'utilisation de structs:
Voici une partie de mon code:
void lectureNoeuds(struct NOEUDS *noeuds,struct INTERFACENOEUD **interfaces)
{
int i,
j;
struct INTERFACENOEUD *tmp;
for(i=0;i<nbNoeuds;i++)
{
fscanf(fichierEntree,"%d",&noeuds[i].numNoeuds);
fscanf(fichierEntree,"%d",&noeuds[i].coordX);
fscanf(fichierEntree,"%d",&noeuds[i].coordY);
fscanf(fichierEntree,"%d",&noeuds[i].nbInterfaces);
fscanf(fichierEntree,"%d",&noeuds[i].coutSlots);
fscanf(fichierEntree,"%d",&noeuds[i].nbTypes);
tmp = (struct
INTERFACENOEUD*)malloc(sizeof(struct INTERFACENOEUD) *
noeuds[i].nbTypes);
printf("Nombre de types : %d\n",noeuds[i].nbTypes);
for(j=0;j<noeuds[i].nbTypes;j++)
{
fscanf(fichierEntree,"%d",&tmp[j].nbCanaux);
printf("%d ",tmp[j].nbCanaux);
fscanf(fichierEntree,"%d",&tmp[j].prix);
printf("%d ",tmp[j].prix);
}
printf("\n");
noeuds[i].interfaces = temp;
}
}
J'ai une erreur au niveau de la ligne en rouge. Mes structs sont definies comme cela:
struct INTERFACENOEUD{
int nbCanaux;
int prix;
};
struct NOEUDS{
int numNoeuds;
int coordX;
int coordY;
int nbInterfaces;
int coutSlots;
int nbTypes;
struct INTERFACENOEUD **interfaces;
};
Un petit coup de pouce m'aiderait beaucoup