push pour Jean

master
Guillaume 2 years ago
parent a499c3ac16
commit 24b1b58f2a

@ -134,6 +134,7 @@ void menuAdmin(VilleIut *tiut[], int nbVilles);
void afficherUnCandidat(Candidat candidat); void afficherUnCandidat(Candidat candidat);
void afficherCandidats(Candidat **candidats, int nbCandidats); void afficherCandidats(Candidat **candidats, int nbCandidats);
int creerCandidat(Candidat *tCand[], int nbCandidats); int creerCandidat(Candidat *tCand[], int nbCandidats);
lChoix supprimerCandidature( lChoix l, int nbchoix);
lChoix creerCandidature(lChoix choixCandid, char ville[50], char departement[50], int decision, int validation); lChoix creerCandidature(lChoix choixCandid, char ville[50], char departement[50], int decision, int validation);
ListeDeptV2 configurationDeptV2( ListeDept ldept ); ListeDeptV2 configurationDeptV2( ListeDept ldept );

@ -8,9 +8,9 @@ int main(void)
// #ifdef _WIN32 // #ifdef _WIN32
// color // color
// #endif // #endif
//guillaume(); guillaume();
//testCharge(); //testCharge();
Globale(); //Globale();
//testJean(); //testJean();
return 0; return 0;

@ -799,8 +799,10 @@ int creerCandidat(Candidat *tCand[], int nbCandidats)
* *
* @return la liste avec le choix en moins * @return la liste avec le choix en moins
*/ */
lChoix supprimerCandidature( lChoix l, int * nbchoix) lChoix supprimerCandidature( lChoix l, int nbchoix)
{ {
lChoix temp = l;
if ( l == NULL ) if ( l == NULL )
{ {
printf(" \n --> Le candidat ne possede aucun choix...\n\n"); printf(" \n --> Le candidat ne possede aucun choix...\n\n");
@ -811,9 +813,10 @@ lChoix supprimerCandidature( lChoix l, int * nbchoix)
printf( " -----------------------------\n\n"); printf( " -----------------------------\n\n");
int rep = 0, c = 0; int rep = 0, c = 0;
for( int i = 0; i < *nbchoix; i ++ ) for( int i = 0; i < nbchoix; i ++ )
{ {
printf(" %d.) Ville : %10s ; Departement : %10s \n",i + 1, l -> ville, l -> departement); printf(" %d.) Ville : %10s ; Departement : %10s \n",i + 1, l -> ville, l -> departement);
l = l -> suiv;
} }
printf(" \n\n --> Quel choix supprimer ? : "); printf(" \n\n --> Quel choix supprimer ? : ");
@ -821,13 +824,12 @@ lChoix supprimerCandidature( lChoix l, int * nbchoix)
while ( c != rep - 1 ) while ( c != rep - 1 )
{ {
l = l -> suiv; temp = temp -> suiv;
c = c + 1; c = c + 1;
} }
l = supprimerEnTeteC( l ); temp = supprimerEnTeteC( temp );
*nbchoix = *nbchoix - 1; return temp;
return l;
} }
/** /**

@ -58,6 +58,9 @@ void guillaume(void)
tCandid[0]->lchoix = creerCandidature(tCandid[0]->lchoix, ville, departement, 0, 0); tCandid[0]->lchoix = creerCandidature(tCandid[0]->lchoix, ville, departement, 0, 0);
tCandid[0]->nbChoix +=1 ; tCandid[0]->nbChoix +=1 ;
afficherUnCandidat(*tCandid[0]); afficherUnCandidat(*tCandid[0]);
supprimerCandidature(tCandid[0]->lchoix, tCandid[0]->nbChoix);
tCandid[0]->nbChoix-=1;
afficherUnCandidat(*tCandid[0]);
} }

Loading…
Cancel
Save