-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path\
89 lines (68 loc) · 2.17 KB
/
\
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
81
82
83
84
85
86
87
88
89
//ciao mondo
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int initData;
void *next;
} Node;
Node *head = NULL;
// 4 opzioni
// AGGIUNGERE
Node *aggiungiNodo(int numero) {
Node *contenitore = NULL;
if (head == NULL) {
contenitore = malloc(sizeof(Node))
if (contenitore = NULL)
return 0;
}
}
// TOGLIERE
// INSERIAMO UNA POSIZIOEN DEL NODO
// STAMPARE
// USCIRE DAL GIOCO
// FUNZIONE DI CONTROLLO
void stampaControlli() {
printf("\n");
printf("###################################################################################################\n");
printf("Questi sono i comandi che puoi usare per la tua linkedList: \n");
printf("\t'1' aggiungera un elemento nella lista , in caso sia vuota verra aggiunta una nuova e spostata a destra quella vecchia\n");
printf("\t'2' togliera un elemento dalla lista\n");
printf("\t'3' inserimenti posizione del nodo\n");
printf("\t'4' ti fara printare le tua lista ->\n");
printf("\t'5' ti fara uscire dal programma\n");
printf("####################################################################################################\n");
printf("\n");
return;
}
int main(int argc, char *argv[]){
int controllo =-2;
while (controllo !=5){
stampaControlli();
int numeroScelto = scanf("%d", &controllo);
if (numeroScelto == 1 && numeroScelto > 0 && numeroScelto < 5){
switch (controllo) {
case 1:
printf("\taggiungo \n");
printf("\n");
break;
case 2:
printf("\ttolgo \n");
printf("\n");
break;
case 3:
printf("\tinserimento\n");
printf("\n");
break;
case 4:
printf("\tPRINTATO\n");
printf("\n");
break;
case 5:
printf("\tquit dal programma\n");
printf("\n");
break;
}
}
}
return 0;
}