-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
42 lines (41 loc) · 1.1 KB
/
main.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
#include "todo.h"
int main() {
// Variabili per controllo input e scelta utente
int ch, check;
// Ciclo infinito finchè non si decide di uscire dal programma
while (1) {
// Stampa del menu con le scelte
displayMenu();
// Ciclo di controllo correttezza input
do {
fflush(stdin);
check = scanf("%d", &ch);
if (check != 1) {
printf("\nErrore nell'input, riprova!\n");
fflush(stdin);
}
} while (check != 1);
// Switch con i diversi case, ognuno per ogni funzione
switch (ch) {
case 1:
createTask();
break;
case 2:
printList();
break;
case 3:
deleteTask();
break;
case 4:
editTask();
break;
case 5:
searchTask();
break;
case 0:
return (stop());
default:
printf("\nScelta non valida\n");
}
}
}