Code:typedef struct innode { char letter; struct innode* next; } InnerNode; typedef struct node { InnerNode* word; struct node* next; } Node; struct node* append(struct node* head) { char input[21]; printf("Enter Word: "); scanf("%20s", &input); Node* word = NULL; // struct node* outernode = malloc(sizeof(struct node)); struct innode* newLetter = malloc(sizeof(struct innode)); struct innode* curr = newLetter; for(int i = 0; i < strlen(input); ++i) { curr->letter = input[i]; if(i+1 < strlen(input)) { curr->next = malloc(sizeof(struct innode)); curr = curr->next; } } word->next = NULL; };
Ich muss jetzt eine outernode erstellen und den ersten letter an diesen anhängen. wie mach ich das?