#include #include typedef struct list { char *word; struct list *next; } *LIST; LIST create(char *x) { LIST q; q = malloc(sizeof *q); q->word = x; q->next = NULL; return q; } LIST append(char *x, LIST p) { LIST q; q = malloc(sizeof *q); p->next = q; q->word = x; q->next = NULL; return q; } void show_list(LIST p) { while (p != NULL) { printf("%s\n", p->word); p = p->next; } } main() { char *words[] = {"abc", "ghi", "xyz"}; int i; LIST p,q; p = q = create(words[0]); for(i=1; i<3; i++) { q = append(words[i], q); } show_list(p); }