correction de bug fonction de chargement où l'on ajoutait 1 au nombre de ville même si elle existait déjà

master
d3friski 2 years ago
parent fb52323535
commit 4dba409b95

@ -34,10 +34,10 @@ int chargIutDon(VilleIut *tVilleIut[], int nbMax, char nomFich[])
strcpy(tVilleIut[i]->nom, nom);
tVilleIut[i]->ldept = listenouv();
ajouterDept(tVilleIut[i]->ldept, nomDept, resp, nbP);
i = i + 1;
}
if(trouve==1)
ajouterDept(tVilleIut[indice]->ldept, nomDept, resp, nbP);
i = i + 1;
fscanf(flot, "%s", nom);
lireDep(flot, nomDept, &nbP, resp);
}

@ -8,11 +8,11 @@
void testJean(void)
{
int nbvilles;
VilleIut **tIut ;
VilleIut *tIut[50] ;
nbvilles= chargIutDon(tIut, 50, "iut.don");
nbvilles= chargIutDon(tIut, 50, "../donnees/iut.don");
tIut = (VilleIut **)malloc(sizeof(VilleIut *)*nbvilles);
//tIut = (VilleIut **)malloc(sizeof(VilleIut *)*nbvilles);
// strcpy(tIut[0]->nom, "John");
// strcpy(tIut[0]->ldept->nomDept, "Info");
// strcpy(tIut[0]->ldept->resp, "YAnis");

Loading…
Cancel
Save