X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_9%2Fexo1%2Fexo1.c;fp=TP_9%2Fexo1%2Fexo1.c;h=e70d29bf5b83baf8f7c444d168c450ab388d6082;hb=1c7a8fe964e67bfcdc3e6550d0a090e8686e8387;hp=0000000000000000000000000000000000000000;hpb=fab9c01b7870244a46f86b79d925e5ada1aea243;p=TD_C.git diff --git a/TP_9/exo1/exo1.c b/TP_9/exo1/exo1.c new file mode 100644 index 0000000..e70d29b --- /dev/null +++ b/TP_9/exo1/exo1.c @@ -0,0 +1,18 @@ +#include + +#include "clist.h" + +int main() { + link_t* head = list_new(1); + printf("Longueur de la liste: %d\n", list_count(head)); + list_append(head, 2); + list_append(head, 3); + list_append(head, 4); + printf("Longueur de la liste: %d\n", list_count(head)); + printf("Valeur a index %d: %d\n", 2, list_get(head, 2)); + printf("Valeur a index %d: %d\n", 3, list_get(head, 3)); + printf("Valeur a index %d: %d\n", 4, list_get(head, 4)); + list_clear(head); + + return 0; +}