diff --git a/part1.c b/part1.c index 50330c1..7dcf06b 100644 --- a/part1.c +++ b/part1.c @@ -118,7 +118,12 @@ ListDept MaJnbP(VilleIUT **tV, char *ville, char dpt, int newnbP) - +ListDept recherche (ListDept l, char *nom ) +{ + if ( l == NULL ){ return l;} + if ( strcmp ( l->departement, nom ) == 0) return l; + return recherche (l->suiv, nom ); +} diff --git a/part1.h b/part1.h index dd1e45e..9070bdb 100644 --- a/part1.h +++ b/part1.h @@ -26,3 +26,4 @@ int Chargement(VilleIUT **tV, int tmax, char *nameFile); void AfficheDpmt ( MaillonDept *dpt ); void afficheIUT (VilleIUT *iut); void Affichetableau(VilleIUT ** TabIUT, int n ); +Liste recherche (Liste l, char *nom );