if(!current) // If no head node, create one
{
head = newNode;
newNode-> next = NULL;
cout << head-> lastName << endl;
cout << "head created" << endl;
}
//else if(head-> lastName.compare(newNode-> lastName) > 0)
elseif(head-> lastName > newNode-> lastName)
{
newNode-> next = head; // here next node is assigned to parent node
head = newNode; // here parent node is assigned back to child node ??
cout << "new head" << endl;
}
Is the above commented part supposed to do this? (assigning something that's already assigned)