From e2bf24c0c823f18b8b19a66401014841f574eb9c Mon Sep 17 00:00:00 2001 From: tvieuble Date: Tue, 30 Apr 2019 18:47:26 +0200 Subject: [PATCH] push --- projetfinalaccent2.c | 41 +++++++++++++++++++++++------------------ projetfinalaccent2.exe | Bin 138805 -> 0 bytes words.txt | 1 + 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/projetfinalaccent2.c b/projetfinalaccent2.c index 3f3c392..54461cd 100644 --- a/projetfinalaccent2.c +++ b/projetfinalaccent2.c @@ -15,21 +15,6 @@ struct cell { struct cell* arbreSuivant; }; -void initialisation_tab_arbre(struct node tab[]) { - int i = 0; - for(wchar_t u = 'a'; u < A-3; u++) { - tab[i].lettre = u; //ajout lettres minuscules - tab[i].listeFils = NULL; - i++; - } - tab[A-3].lettre = '?'; - tab[A-2].lettre = '!'; - tab[A-1].lettre = '\''; - tab[A-3].listeFils = NULL; - tab[A-2].listeFils = NULL; - tab[A-1].listeFils = NULL; -} - void ajout_tete(wchar_t elem, struct cell** pL) { struct cell* p; p = malloc(sizeof(struct cell)); @@ -53,6 +38,22 @@ struct cell ** insertion(wchar_t elem, struct cell** pL) { } } +void initialisation_tab_arbre(struct node tab[]) { + int i = 0; + for(wchar_t u = 'a'; u < A-3; u++) { + tab[i].lettre = u; //ajout lettres minuscules + tab[i].listeFils = NULL; + i++; + } + tab[A-3].lettre = '?'; + tab[A-2].lettre = '!'; + tab[A-1].lettre = '\''; + for(int j = 1; j <= 3; j++) { //Ajout des caractères de ponctuation par défaut + tab[A-j].listeFils = NULL; + insertion('\0', &(tab[A-j].listeFils)); + } +} + int indice_lettre(struct node tab_arbre_prcp[], wchar_t lettre) { int i = 1; @@ -180,7 +181,7 @@ void correction_mot(struct node tab_arbre_prcp[]) { indice = indice_lettre(tab_arbre_prcp, motLu[0]); localisationArbre = &tab_arbre_prcp[indice].listeFils; if(indice == 0) { - wprintf(L"Erreur correction mot : L'un des caracteres n'est pas une lettre\n"); + wprintf(L"Erreur correction mot : L'un des caracteres n'est pas une lettre\n"); verif = 0; } } @@ -203,7 +204,10 @@ void correction_mot(struct node tab_arbre_prcp[]) { void desalocationArbre(struct cell** pL) { - if ((*pL) == NULL) return; + if ((*pL) == NULL) { + printf("return arbre desaloc"); + return; + } desalocationArbre(&(*pL)-> arbreSuivant); desalocationArbre(&(*pL)-> arbre -> listeFils); @@ -215,6 +219,7 @@ void desalocationTableauArbre(struct node tab_arbre[]){ int i = 0; for(wchar_t u = 'a'; u < A; u++) { desalocationArbre(&tab_arbre[i].listeFils); + if(u>=A-4) printf("pas segfault : i = %d", i+1); i++; } } @@ -246,7 +251,7 @@ int main(int argc, char* argv[]) { correction_mot(tab_arbre); desalocationTableauArbre(tab_arbre); - wprintf(L"fini\n"); + printf("fini\n"); return 0; diff --git a/projetfinalaccent2.exe b/projetfinalaccent2.exe index aae6b87..c9ad2c3 100644 Binary files a/projetfinalaccent2.exe and b/projetfinalaccent2.exe differ diff --git a/words.txt b/words.txt index cd28f5b..2f5f5dc 100644 --- a/words.txt +++ b/words.txt @@ -99169,3 +99169,4 @@ zygotes étude étude's études +? \ No newline at end of file -- libgit2 0.21.2