commit
This commit is contained in:
parent
7450b610cb
commit
e704df4a8d
7 changed files with 81 additions and 63 deletions
8
conf.c
8
conf.c
|
@ -4,7 +4,7 @@
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
ptConf newConfChain() {
|
ptConf newConfChain() {
|
||||||
ptConf confChain = (ptConf) malloc(sizeof(ptConf));
|
ptConf confChain = (ptConf) malloc(sizeof(tConf));
|
||||||
|
|
||||||
confChain -> next = NULL;
|
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 -> title, title);
|
||||||
strcpy(px -> speaker, speaker);
|
strcpy(px -> speaker, speaker);
|
||||||
// ajouter le builder de liste de participants
|
// ajouter le builder de liste de participants
|
||||||
px -> next = (ptConf) malloc(sizeof(ptConf));
|
px -> next = (ptConf) malloc(sizeof(tConf));
|
||||||
px -> next -> next = NULL;
|
px -> next -> next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptListener newListenerChain() {
|
ptListener newListenerChain() {
|
||||||
ptListener listenerChain = (ptListener) malloc(sizeof(ptListener));
|
ptListener listenerChain = (ptListener) malloc(sizeof(tListener));
|
||||||
|
|
||||||
listenerChain -> prev = NULL;
|
listenerChain -> prev = NULL;
|
||||||
listenerChain -> next = NULL;
|
listenerChain -> next = NULL;
|
||||||
|
@ -48,7 +48,7 @@ void addListener(ptListener listenerChain, char name[], int age, int level) {
|
||||||
px -> age = age;
|
px -> age = age;
|
||||||
px -> level = level;
|
px -> level = level;
|
||||||
// ajouter la liste de conférences
|
// ajouter la liste de conférences
|
||||||
px -> next = (ptListener) malloc(sizeof(ptListener));
|
px -> next = (ptListener) malloc(sizeof(tListener));
|
||||||
px -> next -> next = NULL;
|
px -> next -> next = NULL;
|
||||||
px -> next -> prev = px;
|
px -> next -> prev = px;
|
||||||
}
|
}
|
9
conf.h
9
conf.h
|
@ -4,7 +4,6 @@
|
||||||
struct listenerList;
|
struct listenerList;
|
||||||
|
|
||||||
typedef struct conf {
|
typedef struct conf {
|
||||||
struct date* date;
|
|
||||||
char title[30];
|
char title[30];
|
||||||
char speaker[20];
|
char speaker[20];
|
||||||
int day;
|
int day;
|
||||||
|
@ -15,8 +14,8 @@ typedef struct conf {
|
||||||
} tConf;
|
} tConf;
|
||||||
|
|
||||||
typedef struct confList {
|
typedef struct confList {
|
||||||
struct tConf* conf;
|
struct conf* conf;
|
||||||
struct tConfList* next;
|
struct confList* next;
|
||||||
} tConfList;
|
} tConfList;
|
||||||
|
|
||||||
typedef struct listener {
|
typedef struct listener {
|
||||||
|
@ -29,8 +28,8 @@ typedef struct listener {
|
||||||
} tListener;
|
} tListener;
|
||||||
|
|
||||||
typedef struct listenerList {
|
typedef struct listenerList {
|
||||||
struct tListener* listener;
|
struct listener* listener;
|
||||||
struct tListenerList* next;
|
struct listenerList* next;
|
||||||
} tListenerList;
|
} tListenerList;
|
||||||
|
|
||||||
typedef tConf* ptConf;
|
typedef tConf* ptConf;
|
||||||
|
|
BIN
main
BIN
main
Binary file not shown.
58
main.c
58
main.c
|
@ -1,6 +1,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
#include "screenManager.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -11,66 +12,23 @@ int main()
|
||||||
addConf(confChain, "test", "tesst", 21, 120, 2023);
|
addConf(confChain, "test", "tesst", 21, 120, 2023);
|
||||||
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;
|
ptConf px = confChain;
|
||||||
|
ptListener py = listenerChain;
|
||||||
|
|
||||||
while (px -> next != NULL) {
|
while (px -> next != NULL) {
|
||||||
printf("title : %s\nspeaker : %s\n", px -> title, px -> speaker);
|
printf("title : %s\nspeaker : %s\n", px -> title, px -> speaker);
|
||||||
|
printf("%d/%d/%d\n", px -> day, px -> month, px -> year);
|
||||||
px = px -> next;
|
px = px -> next;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i=0,j=0;
|
while (py -> next != NULL) {
|
||||||
|
printf("name: %s\nage: %d\nlevel: %d", py -> name, py -> age, py -> level);
|
||||||
////////////////////////// Menu 1 ////////////////////////////////
|
py = py -> next;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu();
|
||||||
|
|
||||||
return 0;
|
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