// gcc -std=c99 -O -Wall -o linkedlist linkedlist.c #include // OBS #include struct node { char *data; // "String" struct node *next; }; typedef struct node *List; List li; // struct node *li; int main(int argc, char* argv[]) { List p; li = NULL; for (int i = 1; i < argc; i++) { // -std=c99 p = (struct node *) malloc(sizeof(struct node)); p->next = li; // (*p).next = li; p->data = argv[i]; li = p; } for (p = li; p != NULL; p = p->next) { printf(" %s", p->data); } printf("\n"); for (p = li; p != NULL; ) { List q = p; p = p->next; free(q); } return 0; }