From 47f7467bddeffc5a07ba88d154dd9899ef462a74 Mon Sep 17 00:00:00 2001 From: "matheo.thierry" Date: Sat, 17 Dec 2022 14:11:36 +0100 Subject: [PATCH] =?UTF-8?q?MODIF=20P2=20mise=20en=20ordre=20du=20code=20et?= =?UTF-8?q?=20s=C3=A9paration=20pour=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sae1-02.c | 88 +++++++++++++++++++------------------------------------ 1 file changed, 30 insertions(+), 58 deletions(-) diff --git a/sae1-02.c b/sae1-02.c index b161348..88991a7 100644 --- a/sae1-02.c +++ b/sae1-02.c @@ -7,9 +7,8 @@ // f enregistrement -/* // Partie 1 - +/* void affichageVilleIUT() { printf("%s\t%s\t%d\t%s") @@ -57,58 +56,18 @@ le tableau de pointeur qui contient listcandinfo et listcand, combien de fonctionnalité en combien de fonction ... - -charger fichier - -modifier choix - -ajouter choix - -supp choix - -afficher les infos d'un cand - -tout cand d'un dep (ordre alphabétique) - -enregistrer fichier - - -charger -- recup : - -nb candi - -listcandinfo - -nb choix - -listcand + V charger fichier + - modifier choix + - ajouter choix + - supp choix + V afficher les infos d'un cand + - tout cand d'un dep (ordre alphabétique) + - enregistrer fichier +*/ --- pb avec ça - -Listchoixdept listchoixdeptvide(void){ - return NULL; -} - -Listchoixdept inserercarte(Listchoixdept c, FILE *fe){ - Maillonchoix* cc; - cc = (Maillonchoix*)malloc(sizeof(Maillonchoix*)); - if(cc==NULL){printf("\n");exit(1);} - fscanf(fe, "%s %s %d %d", cc->Ville, cc->dep, &cc->decision, &cc->validation); - cc->suivant=c; - return cc; -} - -Listchoixdept lireChoix(FILE *fe, int nbchoix){ - int i=0; - int decision, validation; - char Ville[21], dep[21]; - Listchoixdept c, temp; - c = listchoixdeptvide(); - for(i=0; iVille, c->dep, c->decision, c->validation); @@ -158,6 +120,8 @@ void affichage(Listchoixdept c){ affichage(c->suivant); } } + +//affiche que la personne void affichageetu(listetuinfo a){ printf(" %d\n %s %s\n", a.numeroetu, a.nometu, a.prenometu); printf(" mathématique : %d\n", a.notes[0]); @@ -166,23 +130,31 @@ void affichageetu(listetuinfo a){ printf(" matière spé : %d\n", a.notes[3]); } -void test1(void){ - listetuinfo *tetu[5000]; +//affichage general +void affichealletu(listetuinfo *tetu[], int nb){ + int j=0; Listchoixdept b; b = listvide(); - int j, i, nb; - char nomFich[20]; - strcpy( nomFich, "candidature.txt"); - nb = chargeretudiant(nomFich, tetu, 5000); for(j=0; jcarte; affichage(b); printf("\n\n"); } } +//========================================================================================================== + +void test1(void){ + listetuinfo *tetu[5000]; + int nb; + char nomFich[20]; + strcpy( nomFich, "candidature.txt"); + nb = chargeretudiant(nomFich, tetu, 5000); + affichealletu(tetu, nb); +} +