View Single Post
Old 02-03-2008, 01:36 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,696
redhead is on a distinguished road
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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote