Bonjour j'aimerais avoir un code en vue de structure les données de mon programme.j'ai écrit un programme en vue de la gestion de repas consommer et j'aimerais avoir un code en vue d'empiler mes données pour qu'il se suivent . J'ai vraiment essayer mais j'y arrive pas .

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <stdio.h>
#include <stdlib.h>
 
typedef struct{
  int jour;
  int mois;
 int annee;
}Date;
 
typedef struct{
  int heu;
  int minu;
}Heure;
 
typedef struct{
  Date date_p;
  Heure heure_prise;
  char matricule [10];
  char nom[20];
  char prenom [20];
  char sexe;
  int age;
  char repas [20];
  char unite_de_prise[20];
  char lieu_de_prise [20];
 
}Etudiant ;
 
 
int main()
{
    // ENREGISTREMENT DES COLLECTIONS DES DONNEES DES ETUDIANTS
   Etudiant E1 = {{23,03,2022},{12,14},"21T234","MAKEGNI","CHRIS",'M',19,"RIZ SAUCE ARACHIDE","PLAT","MAISON"};
   Etudiant E2 = {{26,03,2022},{14,16},"20Q456","ABAKAR","OUMAR",'M',21,"CORN FLAKES","BOL","MAISON"};
   Etudiant E3 = {{24,03,2022},{14,16},"21T294","AMBASSA","IRENE",'F',18,"OKOK SUCRE","ASSIETE CREUSE","MAISON"};
   Etudiant E4 = {{29,03,2022},{14,16},"2OV256","KOLIMA","DOMINIQUE",'F',22,"POMMES PILEES","ASSIETE CREUSE","MAISON"};
   Etudiant E5 = {{30,03,2022},{14,16},"21T409","MBIDA","WILLIAM",'M',23,"ERU","PLAT","RESTAURANT"};
   Etudiant E6 = {{01,04,2022},{12,14},"21T387","LONTSI","BORIS",'M' ,20,"PAIN OMELLETE","PLAT","CAMPUS"};
 
 
   //AFFICHAGES DES DONNEES COLLECTEES
   printf("\t date : %d / %d / %d    heure de prise : %d h- %d h \n",E1.date_p.jour,E1.date_p.mois,E1.date_p.annee,E1.heure_prise.heu,E1.heure_prise.minu);
   printf("\t matricule = %s \n" ,E1.matricule);
   printf("\t nom & prenom : %s %s \n ",E1.nom,E1.prenom);
   printf("\t sexe : %c    age : %d \n",E1.sexe,E1.age);
   printf("\ repas : %s   unite de prise : %s   lieu de prise : %s  \n",E1.repas,E1.unite_de_prise,E1.lieu_de_prise);
   printf("\n");
    printf("\t date : %d / %d / %d   heure de prise : %d h- %d h \n",E2.date_p.jour,E2.date_p.mois,E2.date_p.annee,E2.heure_prise.heu,E2.heure_prise.minu);
   printf("\t matricule = %s \n" ,E2.matricule);
   printf("\t nom & prenom : %s %s \n ",E2.nom,E2.prenom);
   printf("\t sexe : %c    age :  %d \n",E2.sexe,E2.age);
   printf("\ repas : %s   unite de prise : %s   lieu de prise : %s  \n",E2.repas,E2.unite_de_prise,E2.lieu_de_prise);
   printf("\n");
    printf("\t date : %d / %d / %d   heure de prise : %d h- %d h \n",E3.date_p.jour,E3.date_p.mois,E3.date_p.annee,E3.heure_prise.heu,E3.heure_prise.minu);
   printf("\t matricule = %s \n" ,E3.matricule);
   printf("\t nom & prenom : %s %s \n ",E3.nom,E3.prenom);
   printf("\t sexe :%c     age :  %d \n",E3.sexe,E3.age);
   printf("\ repas : %s   unite de prise : %s   lieu de prise :  %s \n",E3.repas,E3.unite_de_prise,E3.lieu_de_prise);
   printf("\n");
    printf("\t date : %d / %d / %d   heure de prise : %d h- %d h  \n",E4.date_p.jour,E4.date_p.mois,E4.date_p.annee,E4.heure_prise.heu,E4.heure_prise.minu);
   printf("\t matricule = %s \n" ,E4.matricule);
   printf("\t nom & prenom : %s %s \n ",E4.nom,E4.prenom);
   printf("\t sexe : %c    age : %d \n",E4.sexe,E4.age);
   printf("\ repas : %s    unite de prise ; %s   lieu de prise :  %s \n",E4.repas,E4.unite_de_prise,E4.lieu_de_prise);
   printf("\n");
    printf("\t date : %d / %d / %d   heure de prise : %d h- %d h  \n",E5.date_p.jour,E5.date_p.mois,E5.date_p.annee,E5.heure_prise.heu,E5.heure_prise.minu);
   printf("\t matricule = %s \n" ,E5.matricule);
   printf("\t nom & prenom : %s %s \n ",E5.nom,E5.prenom);
   printf("\t sexe :%c      age :  %d \n",E5.sexe,E1.age);
   printf("\ repas : %s     unite de prise : %s   lieu de prise : %s  \n",E5.repas,E5.unite_de_prise,E5.lieu_de_prise);
   printf("\n");
    printf("\t date : %d / %d / %d    heure de prise : %d h- %d h \n",E6.date_p.jour,E6.date_p.mois,E6.date_p.annee,E6.heure_prise.heu,E6.heure_prise.minu);
   printf("\t matricule = %s \n" ,E6.matricule);
   printf("\t nom & prenom : %s %s \n ",E6.nom,E6.prenom);
   printf("\t sexe : %c      age : %d \n",E6.sexe,E6.age);
   printf("\ repas : %s     unite de prise : %s    lieu de prise : %s \n",E6.repas,E6.unite_de_prise,E6.lieu_de_prise);
 
 
return 0;
    }