TP_9 exo2: update Makefile
[TD_C.git] / TP_9 / exo2 / exo2.c
1 #include <stdio.h>
2
3 #include "clist.h"
4
5 int main() {
6 link_t* head = NULL;
7 printf("Longueur de la liste: %d\n", list_count(head));
8 head = list_append(head, 1);
9 head = list_append(head, 2);
10 head = list_append(head, 3);
11 head = list_append(head, 4);
12 printf("Longueur de la liste: %d\n", list_count(head));
13 printf("Valeur a index %d: %d\n", 0, list_get(head, 0));
14 printf("Valeur a index %d: %d\n", 1, list_get(head, 1));
15 printf("Valeur a index %d: %d\n", 2, list_get(head, 2));
16 printf("Valeur a index %d: %d\n", 3, list_get(head, 3));
17 head = list_prepend(head, 5);
18 printf("Longueur de la liste: %d\n", list_count(head));
19 printf("Valeur a index %d: %d\n", 0, list_get(head, 0));
20 printf("Valeur a index %d: %d\n", 4, list_get(head, 4));
21 list_set(head, 0, 78);
22 printf("Valeur a index %d: %d\n", 0, list_get(head, 0));
23 list_clear(head);
24
25 return 0;
26 }