From 19f1dbcf8594573a0e4260ce0e96cacba1db2101 Mon Sep 17 00:00:00 2001 From: Roxane ROSSETTO Date: Tue, 13 Dec 2022 16:30:11 +0100 Subject: [PATCH] lire choix + charg --- commun.c | 40 +++++++++++++++++++++++++++++++++++++++- commun.h | 44 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/commun.c b/commun.c index 9c58b0e..142e1a0 100644 --- a/commun.c +++ b/commun.c @@ -7,6 +7,7 @@ Choix lirechx (void){ Choix chx; + printf("Saisir le choix de la ville\n"); fgets(chx.ville, 20, stdin); chx.ville[strlen(chx.ville)-1]= '\0'; @@ -14,8 +15,11 @@ Choix lirechx (void){ printf("Saisir le choix du departement d'étude\n"); fgets(chx.dptmt, 20, stdin); chx.dptmt[strlen(chx.dptmt)-1]= '\0'; - dghdkfghkeuruufygsdygsydtfyjztfhshc + chx.dec = 0; + chx.valid = 0; + return chx; +} @@ -51,3 +55,37 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier scanf("%d", nbchx); } + + + + + + + + + + + + + + + + + + + + + + + + + + +Choix * chargeChoix(Choix *tchoix, TAILLE, nbchx){ + +} + + + + + diff --git a/commun.h b/commun.h index e293836..ab96e66 100644 --- a/commun.h +++ b/commun.h @@ -7,15 +7,14 @@ /* Brief : */ +#define TAILLE 100; - -typedef struct liste { +typedef struct { char ville[20];//ville choisie char dptmt[20];//département choisi int dec;//décision du choix int valid;//validation du candidat - struct liste * suivant; }Choix; @@ -34,4 +33,41 @@ typedef struct { -Candidat lireCandidat(void); \ No newline at end of file + +Candidat lireCandidat(void); +Choix lirechx (void); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef struct liste { + Choix chx; + struct liste * suivant; +}Maillon; + +