-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject2 interface.c
68 lines (66 loc) · 2.55 KB
/
project2 interface.c
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
/********************************************
Main Ask
*********************************************/
#include<stdio.h>
int i = 0;
int index = 0;
EVENT_T event[2];
int main()
{
char input[64];
double menu;
while(menu!=4)
{
printf("\t---------------------------------------------\n");
printf("\t|| Ghostbusters ||\n");
printf("\t|| Who're you gonna call? Ghostbusters! ||\n");
printf("\t---------------------------------------------\n");
printf("\n");
printf("\t 1.Record");
printf(" 2.search");
printf(" 3.Delete");
printf(" 4.Exit\n");
printf("\n");
printf("Press menu number : ");
fgets(input,sizeof(input),stdin);
sscanf(input,"%lf",&menu);
clearScreen();
if(menu==1)
{
you must use calloc or malloc to create information event depend on amout of it;
memset(event,0,sizeof(event));
for(i=0;i<sizeof(event)/sizeof(EVENT_T);i++)
{
EVENT_T* calloc(sizeof(),sizeof(EVENT_T));
inputAllOfEvent(&event[i],&index);
}
}
else if(menu==2)
{
printf("---------------------------------------------------------------------\n");
printf("||-------------------------- Search Type --------------------------||\n");
printf("---------------------------------------------------------------------\n");
printf("|| 1.Event type ||\n");
printf("|| 2.Event year ||\n");
printf("|| 3.District ||\n");
printf("||-----------------------------------------------------------------||\n");
printf("\n");
searchRecord();
}
else if(menu==3)
{
printf("---------------------------------------------------------------------\n");
printf("||-------------------- Search For Delete. ------------------------||\n");
printf("---------------------------------------------------------------------\n");
printf("|| 1.Event type ||\n");
printf("|| 2.Event year ||\n");
printf("|| 3.District ||\n");
printf("||-----------------------------------------------------------------||\n");
searchRecord();
}
else if(menu==4)
{
return 0;
}
}
}