Commit 79acbdd3 authored by Chris's avatar Chris
Browse files

ll improvements

parent 642ad524
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,4 +38,5 @@ void delete_linked_list(linked_list_item **head) {
        free(current);
        current = next;
    }
    *head = NULL;
}
 No newline at end of file
+8 −2
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
#include "linked_list.h"

int main(void) {
    printf("hello\n");

    linked_list_item *first_element = NULL;
    linked_list_item **head = &first_element;

@@ -20,7 +18,15 @@ int main(void) {
        head = &(*head)->next;
    }

    head = &first_element;
    delete_linked_list(head);

    head = &first_element;
    while ((*head) != NULL) {
        printf("value is %d\n", (*head)->value);
        head = &(*head)->next;
    }


    return 0;
}