diff --git a/commun.c b/commun.c index 142e1a0..1e9cd39 100644 --- a/commun.c +++ b/commun.c @@ -30,18 +30,23 @@ Choix lirechx (void){ + + + + + + + + Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier { Candidat c; - int nEtu,nbchx; - float moymat, moyfr, moyen, moyspe; - char nom[20], prenom[20]; printf("Numéro de candidat :\n"); scanf("%d", &c.nEtu); printf("Nom du candidat :\n"); - fgets(); + fgets(c.nom, 20, stdin); printf("Prénom du candidat :\n"); - fgets(); + fgets(c.prenom, 20, stdin); printf("Moyenne de maths :\n"); scanf("%f", &c.moymat); printf("Moyenne de français :\n"); @@ -53,8 +58,10 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier printf("Nombre de choix :\n"); scanf("%d", &c.nbchx); scanf("%d", nbchx); + return c; } +<<<<<<< HEAD @@ -89,3 +96,12 @@ Choix * chargeChoix(Choix *tchoix, TAILLE, nbchx){ +======= +void AffC(Candidat c) +{ + printf("%d\n", c.nEtu); + printf("%s \n %s\n", c.nom, c.prenom); + printf("%.2f\t%.2f\t%.2f\t%.2f\n", c.moymat,c.moyfr, c.moyen, c.moyspe); + printf("%d\n", c.nbchx); +} +>>>>>>> refs/remotes/origin/master diff --git a/testcommun.c b/testcommun.c index c617419..3dfde61 100644 --- a/testcommun.c +++ b/testcommun.c @@ -2,3 +2,11 @@ #include #include #include "commun.h" + + +int main(void) +{ + Candidat c; + c = lireCandidat(); + return 0; +} \ No newline at end of file