3) Fonction chercherCar qui retourne l'indice dans un tableau d'un caractère recherché, -1 sinon :
Prototype:

  int fonction chercherCar (>> char s[], >> char c)
/* cherche c dans s */
Variables:

  int i=0;    
/*compteur de boucle de parcours de tableau */
  bool trouve = FALSE;  
/* drapeau qui indique que le caractère a été trouvé */

Corps de l'algorithme détaillé:

  while (s[i] != '\0' && !trouve)
     if (s[i] = = c)
         trouve = TRUE ;
     else
          i = i + 1;
  if (trouve)
      return(i);
  else
      return (-1);


chercherCar ("AZERTY", 'E');      /* renvoie 2 */
chercherCar ("AZERTY", 'Q');     /* renvoie -1 */
chercherCar ("AZERTZ", 'Z');      /* renvoir 1 */

suivant
            plan