advance part 4

master
Roxane ROSSETTO 2 years ago
parent 3354edbf32
commit e32572c7e1

@ -273,11 +273,12 @@ Filecand ChargementfileC(Filecand fC, int *nbC)//chargement du fichier dans cett
return fC; return fC;
} }
int chargement (Candidat tCandAcc[], int tmax, FILEfe){// chargement des files cand et chx int chargement (Candidat tCandAcc[], int tmax, FILE *fe){// chargement des files cand et chx
int i; int i, nbCand;
Candidat c;
Choix chx; Choix chx;
fscanf( fe, "%d", nbCand ); fscanf( fe, "%d", &nbCand );
c = lireCa (fe); c = lireCa (fe);
@ -291,7 +292,7 @@ int chargement (Candidat tCandAcc[], int tmax, FILEfe){// chargement des files c
printf("Problème malloc\n"); printf("Problème malloc\n");
return -1; return -1;
} }
*tCandAcc[i] = c; tCandAcc[i] = c;
fscanf( fe, "%d", &nbC); fscanf( fe, "%d", &nbC);
for ( i=0 ; i<nbc ; i ++){ for ( i=0 ; i<nbc ; i ++){
chx = lireC( fe ); chx = lireC( fe );
@ -308,7 +309,7 @@ int chargement (Candidat tCandAcc[], int tmax, FILEfe){// chargement des files c
void test (void){ void test (void){
FILE *fe; FILE *fe;
int menu1, tlog; int menu1, tlog;
CandidattCand[120]; Candidat *tCand[120];
fe = fopen( "part4.don", "r"); fe = fopen( "part4.don", "r");
if ( fe == NULL ){ if ( fe == NULL ){
@ -321,6 +322,7 @@ void test (void){
fC = ChargementfileC(fC, &nbC); fC = ChargementfileC(fC, &nbC);
tlog = chargement (tCand, 120, fe); tlog = chargement (tCand, 120, fe);
Afftab(tCand, tlog); Afftab(tCand, tlog);
/* /*

@ -52,7 +52,7 @@ Filecand enfC(Filecand fC, Candidat c);
Filechx enf(Filechx fchx, Choix c); Filechx enf(Filechx fchx, Choix c);
Choix def(Filechx fc); Choix def(Filechx fc);
Candidat defC(Filecand fC); Candidat defC(Filecand fC);
int chargement (Candidat tCandAcc[], int tmax, FILEfe);// chargement des files cand et chx int chargement (Candidat tCandAcc[], int tmax, FILE *fe);// chargement des files cand et chx
void test (void); void test (void);

Loading…
Cancel
Save