#include #include #include #include struct name { char name[32]; struct name* next; }; void add(struct name* head, char *name){ while(head->next){ head = head->next; } struct name *new_name = malloc(sizeof(struct name)); strcpy(new_name->name, name); head->next = new_name; new_name->next = 0; } void print_list(struct name *head){ while(head){ puts(head->name); head = head->next; } } int main(){ struct name first_name; first_name.next = 0; strcpy(first_name.name, "Heidi"); add(&first_name, "Zip"); add(&first_name, "Zandy"); print_list(&first_name); return 0; }