ajoute de existeVille ( jean )

master
Siwa12100 2 years ago
parent 953d5347ed
commit cc6289dbae

@ -122,6 +122,7 @@ int modifieRespDept(VilleIut *tVilleIut[], int nbVilles, char ville[], char nomD
void afficheIUTDept(VilleIut* *villeIut, int nbVilles, char *nomDept); void afficheIUTDept(VilleIut* *villeIut, int nbVilles, char *nomDept);
void afficheVillesIUT(VilleIut **villeIut, int nbVilles); void afficheVillesIUT(VilleIut **villeIut, int nbVilles);
void afficheNbPlacesDep(VilleIut *tVilleIut[], int nbVilles, char nomDept[]); void afficheNbPlacesDep(VilleIut *tVilleIut[], int nbVilles, char nomDept[]);
int existeVille( VilleIut * tIut[], char ville[], int nbvilles );
void menuAdmin(VilleIut **villeIut, int nbVilles); void menuAdmin(VilleIut **villeIut, int nbVilles);
void afficherCandidat(Candidat candidat); void afficherCandidat(Candidat candidat);

@ -514,7 +514,18 @@ void afficheNbPlacesDep(VilleIut *tVilleIut[], int nbVilles, char nomDept[])
} }
int existeVille( VilleIut * tIut[], char ville[], int nbvilles )
{
int i = 0;
// Recherche de la ville
for ( i = 0; i < nbvilles, i ++ )
{
if ( strcmp( tIut[i] -> nom, ville ) == 0 ) return i;
}
return -1;
}
/** /**
* Affiche et gère le menu administrateur. * Affiche et gère le menu administrateur.
@ -581,10 +592,6 @@ void menuAdmin(VilleIut **villeIut, int nbVilles)
} }
/* /*
================================================ ================================================
Partie 2 Partie 2

Loading…
Cancel
Save