Guest User

Untitled

a guest
Apr 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.83 KB | None | 0 0
  1. void recherche_adherent(adherent_t *adhr, int *n)
  2. {
  3. char personne[50];
  4. char choix='o';
  5. int trouve,i,str;
  6. while (choix=='o')
  7.     {
  8.     system("clear");
  9.     trouve=-1;i=0;str=0;
  10.     printf("Qui est l'adhérent recherché ?\n");
  11.     lire_chaine(personne, 50);
  12.     while (i<(*n))
  13.         {
  14.         str=(strcmp(adhr[i].adh_nom,personne));
  15.         if (str==0)
  16.             {
  17.             trouve=i;
  18.  
  19.             printf("Nom : %s | N°Adherent : %d | Ville : %s | Code Postal : %d | Nom de Rue : %s\n", adhr[trouve].adh_nom, (adhr[trouve]).adh_num, adhr[trouve].adh_adresse.adr_ville, (adhr[trouve]).adh_adresse.adr_cp, adhr[trouve].adh_adresse.adr_rue);
  20.             }
  21.         i++;
  22.         }
  23.  
  24.        if (trouve ==-1) printf("Il n'y a pas d'utilisateur à ce nom.\n");
  25.  
  26.     printf("Souhaitez vous lancer une nouvelle recherche (o) ou retourner au menu adhérent (n).\n");
  27.     choix = lire_caractere();
  28.     }
  29. menu_adherents();
  30. };
Add Comment
Please, Sign In to add comment