#include #include "chaine_trier.h" void chaine_trier(char *liste_de_chaines[], int taille_liste) { int fin, courant; for (fin = taille_liste - 1; fin > 0; fin--) { int modifie = 0; for (courant = 0; courant < fin; courant++) { if (strcoll(liste_de_chaines[courant], liste_de_chaines[courant+1]) > 0) { /* Echange de courant et courant+1 */ char *tmp = liste_de_chaines[courant]; liste_de_chaines[courant] = liste_de_chaines[courant+1]; liste_de_chaines[courant+1] = tmp; modifie = 1; } } if (!modifie) break; } }