#include #include // how many bytes is this struct? // 12 bytes (on my machine) struct node { int data; struct node *next; }; struct node *create_node(int data, struct node *next) { // create the node on the heap struct node *new_node = malloc(sizeof(struct node)); // assign data and next new_node->data = data; new_node->next = next; return new_node; } // will it work if it's empty? // will it work if first node, a node within a LL, and the tail node void print_ll(struct node *head) { struct node *current = head; while(current != NULL) { printf("%d -> ", current->data); current = current->next; } printf("NULL \n"); } int main(void) { // creating the first node // next can't be uninitialised struct node *head = create_node(4, NULL); // is redefined to point to the new node, which points to the head defined on line 26 head = create_node(11, head); head = create_node(8, head); // print_ll(head); print_ll(head->next); return 0; }