commit
This commit is contained in:
parent
7450b610cb
commit
e704df4a8d
7 changed files with 81 additions and 63 deletions
10
conf.c
10
conf.c
|
@ -4,7 +4,7 @@
|
|||
#include "conf.h"
|
||||
|
||||
ptConf newConfChain() {
|
||||
ptConf confChain = (ptConf) malloc(sizeof(ptConf));
|
||||
ptConf confChain = (ptConf) malloc(sizeof(tConf));
|
||||
|
||||
confChain -> next = NULL;
|
||||
|
||||
|
@ -24,12 +24,12 @@ void addConf(ptConf confChainStart, char title[], char speaker[], int day, int m
|
|||
strcpy(px -> title, title);
|
||||
strcpy(px -> speaker, speaker);
|
||||
// ajouter le builder de liste de participants
|
||||
px -> next = (ptConf) malloc(sizeof(ptConf));
|
||||
px -> next = (ptConf) malloc(sizeof(tConf));
|
||||
px -> next -> next = NULL;
|
||||
}
|
||||
|
||||
ptListener newListenerChain() {
|
||||
ptListener listenerChain = (ptListener) malloc(sizeof(ptListener));
|
||||
ptListener listenerChain = (ptListener) malloc(sizeof(tListener));
|
||||
|
||||
listenerChain -> prev = NULL;
|
||||
listenerChain -> next = NULL;
|
||||
|
@ -48,7 +48,7 @@ void addListener(ptListener listenerChain, char name[], int age, int level) {
|
|||
px -> age = age;
|
||||
px -> level = level;
|
||||
// ajouter la liste de conférences
|
||||
px -> next = (ptListener) malloc(sizeof(ptListener));
|
||||
px -> next = (ptListener) malloc(sizeof(tListener));
|
||||
px -> next -> next = NULL;
|
||||
px -> next -> prev = px;
|
||||
}
|
||||
}
|
||||
|
|
11
conf.h
11
conf.h
|
@ -4,7 +4,6 @@
|
|||
struct listenerList;
|
||||
|
||||
typedef struct conf {
|
||||
struct date* date;
|
||||
char title[30];
|
||||
char speaker[20];
|
||||
int day;
|
||||
|
@ -15,8 +14,8 @@ typedef struct conf {
|
|||
} tConf;
|
||||
|
||||
typedef struct confList {
|
||||
struct tConf* conf;
|
||||
struct tConfList* next;
|
||||
struct conf* conf;
|
||||
struct confList* next;
|
||||
} tConfList;
|
||||
|
||||
typedef struct listener {
|
||||
|
@ -29,8 +28,8 @@ typedef struct listener {
|
|||
} tListener;
|
||||
|
||||
typedef struct listenerList {
|
||||
struct tListener* listener;
|
||||
struct tListenerList* next;
|
||||
struct listener* listener;
|
||||
struct listenerList* next;
|
||||
} tListenerList;
|
||||
|
||||
typedef tConf* ptConf;
|
||||
|
@ -43,4 +42,4 @@ void addConf(ptConf confChainStart, char title[], char speaker[], int day, int m
|
|||
ptListener newListenerChain();
|
||||
void addListener(ptListener listenerChain, char name[], int age, int level);
|
||||
|
||||
#endif // CONF_H
|
||||
#endif // CONF_H
|
||||
|
|
BIN
main
BIN
main
Binary file not shown.
62
main.c
62
main.c
|
@ -1,6 +1,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "conf.h"
|
||||
#include "screenManager.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@ -11,66 +12,23 @@ int main()
|
|||
addConf(confChain, "test", "tesst", 21, 120, 2023);
|
||||
addConf(confChain, "test", "tesst", 21, 120, 2023);
|
||||
|
||||
//addListener(listenerChain, "Roger", 19, 4);
|
||||
addListener(listenerChain, "Roger", 19, 4);
|
||||
|
||||
ptConf px = confChain;
|
||||
ptListener py = listenerChain;
|
||||
|
||||
while (px -> next != NULL) {
|
||||
printf("title : %s\nspeaker : %s\n", px -> title, px -> speaker);
|
||||
printf("%d/%d/%d\n", px -> day, px -> month, px -> year);
|
||||
px = px -> next;
|
||||
}
|
||||
|
||||
int i=0,j=0;
|
||||
|
||||
////////////////////////// Menu 1 ////////////////////////////////
|
||||
|
||||
printf("\n 1/ Gestion des conferences\n 2/ Gestion des abonnes\n 3/ Participer a une conference");
|
||||
printf("\n 4/ Voir la meilleure conference\n 5/ Voir la participation a une conference");
|
||||
printf("\n 6/ Quitter\n");
|
||||
|
||||
|
||||
scanf("%d",&i);
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
switch (i){
|
||||
|
||||
//////////////////////// Menu conf /////////////////////////
|
||||
|
||||
case 1:{
|
||||
printf("\n 1/ Voir la liste des conferences\n 2/ Ajouter une conference \n 3/ Suprimer une conference\n 4/ Retour\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/////////////////////// Menu abonne /////////////////////////
|
||||
|
||||
case 2: {
|
||||
printf("\n 1/ Voir la liste des abonnes\n 2/ Ajouter un abonne \n 3/ Suprimer un abonne\n 4/ Retour\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case 3: {
|
||||
printf("\n Nom de l'abonne : \n Nom de la conference : \n Note de la conference : ");
|
||||
break;
|
||||
}
|
||||
|
||||
case 4: {
|
||||
printf("\n Nom : \n Note : ");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 5: {
|
||||
printf("\n Entrer le nom de la conference : ");
|
||||
break;
|
||||
}
|
||||
|
||||
case 6: {
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
while (py -> next != NULL) {
|
||||
printf("name: %s\nage: %d\nlevel: %d", py -> name, py -> age, py -> level);
|
||||
py = py -> next;
|
||||
}
|
||||
|
||||
|
||||
menu();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
BIN
main.exe
Normal file
BIN
main.exe
Normal file
Binary file not shown.
55
screenManager.c
Normal file
55
screenManager.c
Normal file
|
@ -0,0 +1,55 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include "screenManager.h"
|
||||
|
||||
void menu() {
|
||||
int i=0;
|
||||
|
||||
////////////////////////// Menu 1 ////////////////////////////////
|
||||
|
||||
printf("\n 1/ Gestion des conferences\n 2/ Gestion des abonnes\n 3/ Participer a une conference");
|
||||
printf("\n 4/ Voir la meilleure conference\n 5/ Voir la participation a une conference");
|
||||
printf("\n 6/ Quitter\n");
|
||||
|
||||
|
||||
scanf("%d",&i);
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
switch (i){
|
||||
|
||||
//////////////////////// Menu conf /////////////////////////
|
||||
|
||||
case 1:{
|
||||
printf("\n 1/ Voir la liste des conferences\n 2/ Ajouter une conference \n 3/ Suprimer une conference\n 4/ Retour\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/////////////////////// Menu abonne /////////////////////////
|
||||
|
||||
case 2: {
|
||||
printf("\n 1/ Voir la liste des abonnes\n 2/ Ajouter un abonne \n 3/ Suprimer un abonne\n 4/ Retour\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case 3: {
|
||||
printf("\n Nom de l'abonne : \n Nom de la conference : \n Note de la conference : ");
|
||||
break;
|
||||
}
|
||||
|
||||
case 4: {
|
||||
printf("\n Nom : \n Note : ");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 5: {
|
||||
printf("\n Entrer le nom de la conference : ");
|
||||
break;
|
||||
}
|
||||
|
||||
case 6: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
6
screenManager.h
Normal file
6
screenManager.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef SREEN_MANAGER_H
|
||||
#define SREEN_MANAGER_H
|
||||
|
||||
void menu();
|
||||
|
||||
#endif // SCREEN_MANAGER
|
Loading…
Add table
Add a link
Reference in a new issue