Ajout de la fonction rechercheIUT

master
Maël DAIM 3 years ago
parent 4c7f7b89be
commit d43cf2038b

@ -87,6 +87,28 @@ bool vide(ListeDept lDept)
return l->v;
}*/
int rechercheIUT(VilleIUT *tiut[], int tLog, char ville[], int *trouve)
{
int inf,sup,t;
inf=0;
sup=tLog-1;
while(inf<=sup)
{
t=(inf+sup)/2;
if(strcmp(ville,tiut[t]->nom)==0)
{
*trouve=1;
return t;
}
if(strcmp(ville,tiut[t]->nom)<0)
sup=t-1;
else inf=t+1;
}
*trouve=0;
return inf;
}
ListeDept rechercherDept(ListeDept lDept, char dept[], int *trouve)
{
if(vide(lDept))

Loading…
Cancel
Save