TP_9 exo1: split the linked list implementation into reusable code
[TD_C.git] / TP_9 / exo1 / exo1.c
CommitLineData
1c7a8fe9
JB
1#include <stdio.h>
2
3#include "clist.h"
4
5int main() {
6 link_t* head = list_new(1);
7 printf("Longueur de la liste: %d\n", list_count(head));
8 list_append(head, 2);
9 list_append(head, 3);
10 list_append(head, 4);
11 printf("Longueur de la liste: %d\n", list_count(head));
12 printf("Valeur a index %d: %d\n", 2, list_get(head, 2));
13 printf("Valeur a index %d: %d\n", 3, list_get(head, 3));
14 printf("Valeur a index %d: %d\n", 4, list_get(head, 4));
15 list_clear(head);
16
17 return 0;
18}