I\'m trying to create a singly linked list from an input text file for an assignment. I\'m trying to do it a little bit at a time so I know my code is not complete. I trie
You shouldn't be incrementing head after head = head->next
in the for loop. PrintList will return NULL every time since the loop wont stop until head is NULL. Why do you need to return the head of the list you just passed to the function anyway?
Edit:
LIST *current = head;
while (current != NULL) {
printf("%s %d", current->str, current->count);
current = current->next;
}