diff --git a/part4.c b/part4.c index 4951731..0c39e3b 100644 --- a/part4.c +++ b/part4.c @@ -273,11 +273,12 @@ Filecand ChargementfileC(Filecand fC, int *nbC)//chargement du fichier dans cett return fC; } -int chargement (Candidat tCandAcc[], int tmax, FILEfe){// chargement des files cand et chx - int i; +int chargement (Candidat tCandAcc[], int tmax, FILE *fe){// chargement des files cand et chx + int i, nbCand; + Candidat c; Choix chx; - fscanf( fe, "%d", nbCand ); + fscanf( fe, "%d", &nbCand ); c = lireCa (fe); @@ -286,12 +287,12 @@ int chargement (Candidat tCandAcc[], int tmax, FILEfe){// chargement des files c printf("La liste des candidats admis est complète\n"); return 0; } - tCandAcc[i] = (Candidat *) malloc (sizeof(Candidat)); + tCandAcc[i] = (Candidat*) malloc (sizeof(Candidat)); if (tCandAcc[i] == NULL ){ printf("Problème malloc\n"); return -1; } - *tCandAcc[i] = c; + tCandAcc[i] = c; fscanf( fe, "%d", &nbC); for ( i=0 ; i