Hello, i am struggling with creating linked lists that are linked to the head list, I know how to create the head list but how can i link the others with it
help please
here is my code
What is tailPtr when the else branch is reached? If it's NULL, you're dereferencing a null pointer on line 21 with tailPtr->next. Also, you have both tailPtr->next and tailPtr itself being set to temp. Is that what you want? Also, since you have a tailPtr, wouldn't its "next" always be NULL?
It's hard to tell, but maybe something like this is what you want? Not sure if this will help.