Quote:
but I'm having an issue when I try and display it of whatever the most recent name I added being shown for each person in the list.
Code:
// Insert at the front of the list
if(lname != (*head)->lname)
{
newnode->next = *head;
*head = newnode;
return;
}
|
Isn't this a false way of doing it ??
you will never reach the while loop for inserting your node.
Unless your added node is the exact same as the very first node in your list.
For some further thoughts on this subject, you might want to read teh
Pointer error thread.
For some fun with how to handle pointers, you might want to read my example in the
File-I/O arrays thread.