From 8435d4c0b5f8dd7ab72918d3fecfd37c7ec23d0b Mon Sep 17 00:00:00 2001 From: "yann.champeau" Date: Fri, 13 Jan 2023 21:31:48 +0100 Subject: [PATCH] Ajustements. --- src/partie2/saeP2.c | 12 +++++++----- src/partie2/saeP2.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/partie2/saeP2.c b/src/partie2/saeP2.c index a5308e7..fed151b 100644 --- a/src/partie2/saeP2.c +++ b/src/partie2/saeP2.c @@ -162,23 +162,25 @@ void ListeCandidat(int nbcandidat,candidat *tcandidat[]) printf("Candidat non trouvé"); } -void Candidater(VilleIUT* tiut[],int tlogi, candidat* tcandidat[], int numcandid) +void Candidater(VilleIUT* tiut[],int tlogi, candidat* tcandidat[], int nbcandidat) { char VilleRech[31]; - printf("Veuillez entrez la ville de l'IUT au quel vous souhaitez candidatez :"); + printf("Veuillez entrez la ville de l'IUT au quel vous souhaitez candidatez : "); scanf("%s",VilleRech); int ind=rechercheIUT(tiut,tlogi,VilleRech); if(ind==-1) return; else { char DepRech[31]; - printf("Veuillez entrez le département dans lequel vous souhaitez y postuler :"); + printf("Veuillez entrez le département dans lequel vous souhaitez y postuler : "); scanf("%s",DepRech); if (existeDep(tiut[ind]->ldept, DepRech)==0) return; else { - int i; - for (i=0;tcandidat[i]->numcandid!=numcandid;++i); + int i, numcandid; + printf("Veuillez entrez le numéro du candidat qui lui a été attribué : "); + scanf("%d",&numcandid); + for (i=0;tcandidat[i]->numcandid!=numcandid && iville,VilleRech); strcpy(voeu_ajout->dep,DepRech); diff --git a/src/partie2/saeP2.h b/src/partie2/saeP2.h index bfd8d80..cf781c9 100644 --- a/src/partie2/saeP2.h +++ b/src/partie2/saeP2.h @@ -116,7 +116,7 @@ void ListeCandidat(int nbcandidat,candidat *tcandidat[]); * \param [in,out] tcandidat Tableau contenant les candidats. * \param [in] numcandid numéro du candidat à chercher. */ -void Candidater(VilleIUT* tiut[],int tlogi, candidat* tcandidat[],int numcandid); +void Candidater(VilleIUT* tiut[],int tlogi, candidat* tcandidat[], int nbcandidat; /* Permet de candidater dans un IUT Entrée :