diff --git a/header/sae.h b/header/sae.h index 1ed0b26..c917400 100644 --- a/header/sae.h +++ b/header/sae.h @@ -88,6 +88,8 @@ typedef struct ------------------------------------------------------------------------ */ // sae.c +void testJean(void); + void Globale(void); Log * chargementLog(char * nomFichier); //void menuVisiteur(VilleIut *villeIut, int nbVilles); @@ -101,7 +103,7 @@ void seConnecterTest(void); int modifiePlacesDept(VilleIut *villeIut, int nbVilles, char *ville, char *nomDept, int nbP); void afficheIUTDept(VilleIut *villeIut, int nbVilles, char *nomDept); -void afficheVillesIUT(VilleIut *villeIut, int nbVilles); +void afficheVillesIUT(VilleIut **villeIut, int nbVilles); void menuAdmin(VilleIut *villeIut, int nbVilles); void afficherCandidat(Candidat candidat); @@ -125,3 +127,4 @@ void afficherListe(ListeDept ldept); int chargIutDon(VilleIut *tVilleIut[], int nbMax, char nomFich[]); void lireDep(FILE *flot, char nomDept[], int *nbP, char resp[]); int appartientIut(VilleIut *tVilleIut[], int nb, char nom[], int *trouve); + diff --git a/source/chargEtSauvFich.c b/source/chargEtSauvFich.c index be73c61..bebde0d 100644 --- a/source/chargEtSauvFich.c +++ b/source/chargEtSauvFich.c @@ -1,4 +1,4 @@ -#include "sae.h" +#include "../header/sae.h" int chargIutDon(VilleIut *tVilleIut[], int nbMax, char nomFich[]) { diff --git a/source/main.c b/source/main.c index df5064d..865a1fe 100644 --- a/source/main.c +++ b/source/main.c @@ -1,5 +1,7 @@ #include "../header/sae.h" + + int main(void) { @@ -7,7 +9,11 @@ int main(void) color #endif - Globale(); + //Globale(); + + testJean(); + + return 0; //system("color 01"); diff --git a/source/sae.c b/source/sae.c index 805391f..8fd7f5d 100644 --- a/source/sae.c +++ b/source/sae.c @@ -309,20 +309,21 @@ void afficheIUTDept(VilleIut *villeIut, int nbVilles, char *nomDept) } } + /** - * Affiche les villes qui ont des IUT. - * - * @param villeIut tableau de pointeurs sur les structures VilleIut - * @param nbVilles nombre de villes dans le tableau villeIut - */ -void afficheVillesIUT(VilleIut *villeIut, int nbVilles) + +Affiche les villes qui ont des IUT. +@param villeIut tableau de pointeurs sur les structures VilleIut +@param nbVilles nombre de villes dans le tableau villeIut +*/ +void afficheVillesIUT(VilleIut **villeIut, int nbVilles) { - int i; - for (i = 0; i < nbVilles; i++) - { - // Affichage du nom de la ville - printf("%s\n", villeIut[i].nom); - } +int i; +for (i = 0; i < nbVilles; i++) +{ +// Affichage du nom de la ville +printf("%s\n", villeIut[i]->nom); +} } /** diff --git a/source/test.c b/source/test.c index 0fefc61..69b589f 100644 --- a/source/test.c +++ b/source/test.c @@ -7,13 +7,18 @@ */ void testJean(void) { - VilleIut **tIut = (VilleIut **)malloc(sizeof(VilleIut *)*5); - strcpy(tIut[0]->nom, "John"); - strcpy(tIut[0]->ldept->nomDept, "Info"); - strcpy(tIut[0]->ldept->resp, "YAnis"); - tIut[0]->ldept->nbP = 12; - tIut[0]->ldept->suiv = NULL; + int nbvilles; + VilleIut **tIut ; + nbvilles= chargIutDon(tIut, 50, "iut.don"); - //afficheVillesIUT(tIut, 0); + tIut = (VilleIut **)malloc(sizeof(VilleIut *)*nbvilles); + // strcpy(tIut[0]->nom, "John"); + // strcpy(tIut[0]->ldept->nomDept, "Info"); + // strcpy(tIut[0]->ldept->resp, "YAnis"); + // tIut[0]->ldept->nbP = 12; + // tIut[0]->ldept->suiv = NULL; + + + afficheVillesIUT(tIut, nbvilles); } diff --git a/suiv b/suiv deleted file mode 100644 index e69de29..0000000