diff --git a/SAE.c b/SAE.c index 1c6ab53..799fbb6 100644 --- a/SAE.c +++ b/SAE.c @@ -1407,7 +1407,8 @@ ListeDept traiterDept(ListeDept l, FILE *flot) int nbPlaces; fscanf(flot, "%s %d", dept, &nbPlaces); fgets(nom, 30, flot); - nom[strlen(nom) - 1] = '\0'; + decalagenom(nom,0,strlen(nom)); + nom[strlen(nom) - 2] = '\0'; printf("Nom du départ : %s\n", dept); l = insererDept(l, dept, nom, nbPlaces); return l; @@ -1592,7 +1593,7 @@ void SauvegardeCandidDept(ChoixDept **tDept, int nbDept, FILE *flot) int verifChefDepart(VilleIUT **tiut, int nbEle, char *dept, char *ville, char *nom) { - int i, verif = 0; + int i, verif = 0, test; ListeDept l; for (i = 0; i < nbEle; i++) { @@ -1639,11 +1640,14 @@ int gestionResponsable(VilleIUT **tiut, int nbEle, Candidat **tcandid, int taill Candidat** tabCandidV; printf("Nom du département concernée : "); scanf("%s%*c", dept); + printf("%s\n",dept); printf("\nNom de la ville concernée : "); scanf("%s%*c", ville); + printf("%s\n",ville); printf("\nNom du responsable du département : "); fgets(nom, 30, stdin); nom[strlen(nom) - 1] = '\0'; + printf("%s",nom); printf("\n"); codeRet = verifChefDepart(tiut, nbEle, dept, ville, nom); if (codeRet == 0) @@ -1962,4 +1966,11 @@ void gérerAdmiCandid(Candidat **tab, int nbCandid) if (!verifSelection()) break; } -} \ No newline at end of file +} + +void decalagenom(char* tab, int pos, int nbEle) +{ + int i; + for(i = pos; i < nbEle - 1; i++) + tab[i] = tab[i + 1]; +} diff --git a/SAE.h b/SAE.h index 92e7bd1..1ef37f1 100644 --- a/SAE.h +++ b/SAE.h @@ -260,4 +260,6 @@ void rejeterVoeux(ListeCandid l, char ville[]); int decision(void); -void gérerAdmiCandid(Candidat **tab, int nbCandid); \ No newline at end of file +void gérerAdmiCandid(Candidat **tab, int nbCandid); + +void decalagenom(char* tab, int pos, int nbEle); \ No newline at end of file