13/01 Fixe bug nom chargement

master
Louis LABORIE 2 years ago
parent bab380bb8f
commit f3618e5fd5

17
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;
}
}
}
void decalagenom(char* tab, int pos, int nbEle)
{
int i;
for(i = pos; i < nbEle - 1; i++)
tab[i] = tab[i + 1];
}

@ -260,4 +260,6 @@ void rejeterVoeux(ListeCandid l, char ville[]);
int decision(void);
void gérerAdmiCandid(Candidat **tab, int nbCandid);
void gérerAdmiCandid(Candidat **tab, int nbCandid);
void decalagenom(char* tab, int pos, int nbEle);
Loading…
Cancel
Save