diff --git a/sae b/sae index 5fbf192..4c1c428 100755 Binary files a/sae and b/sae differ diff --git a/sae1-02.c b/sae1-02.c index 96effad..022f442 100644 --- a/sae1-02.c +++ b/sae1-02.c @@ -114,7 +114,7 @@ Listchoixdept ensemblevide(void){return NULL;} Listchoixdept lireCarte(FILE *fe, int nbchoix){ if(nbchoix==0){return NULL;} Maillonchoix* cc; - cc = (Maillonchoix*)malloc(sizeof(Maillonchoix*)); + cc = (Maillonchoix*)malloc(sizeof(Maillonchoix)); fscanf(fe, "%s %s %d %d", cc->Ville, cc->dep, &cc->decision, &cc->validation); cc->suivant = lireCarte(fe, nbchoix-1); return cc; @@ -130,17 +130,19 @@ listetuinfo lireEtu(FILE *fe){ int chargeretudiant(char nomFich[], listetuinfo *tetu[], int tmax){ int i=0, nbetu; listetuinfo a; + Listchoixdept b; FILE *fe; fe = fopen( nomFich, "r"); if(fe==NULL){printf("\n");return-1;} fscanf(fe, "%d", &nbetu); - *a.carte = ensemblevide(); + b = ensemblevide(); for(i=0; i");fclose(fe);return-1;} tetu[i] = (listetuinfo*)malloc(sizeof(listetuinfo)); if(tetu[i]==NULL){printf("\n");fclose(fe);return-1;} a = lireEtu(fe); - *a.carte = lireCarte(fe, a.nbchoix); + b = lireCarte(fe, a.nbchoix); + a.carte = b; *tetu[i] = a; } fclose(fe); diff --git a/sae1-02.h b/sae1-02.h index 6881ccb..5ccfbd8 100644 --- a/sae1-02.h +++ b/sae1-02.h @@ -41,7 +41,7 @@ typedef struct{ char prenometu[21]; int notes[4]; int nbchoix; - Listchoixdept* carte; + Listchoixdept carte; }listetuinfo; // Partie 3 @@ -60,4 +60,4 @@ typedef struct listatt{ struct listatt* suivant; }maillonatt; -void test1(void); \ No newline at end of file +void test1(void); diff --git a/sase b/sase new file mode 100755 index 0000000..666f229 Binary files /dev/null and b/sase differ