diff --git a/Commun.c b/Commun.c index f19dfcd..e0c0761 100644 --- a/Commun.c +++ b/Commun.c @@ -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))