I tried to make a linked list and it won't work, what's wrong with it?
Code:#include <stdio.h> void main(void) { struct node { char *name; int count; struct node *next; }; struct node root = {"Start", 1, 0}; while(root.count < 20) { root->next = malloc(sizeof(root)); root.name = "Benny Hill"; root.count += 1; root->next = NULL; } while(root != NULL) { printf("%s", root.name); root = root->next; } }