am trying to delete an element from my list but am having a problem..i have managed to position my pointers well but av failed to to the actual element. i.e user enters a number to be deleted from the list..here's the bit of the deleting code that i have been working on
void delete_record(nodePtr& head, nodePtr& current)
{
nodePtr previous=NULL;
edit_record(head,current);
string name;
cout<<"Enter the name you wish to delete:";
cin >> name;
cout<< endl;
if(current->link==name)
{
previous=head;
current=head->link;
while(current->name!=name)
{
previous=current;
current=current->link;
}
current=current->link;
previous=previous->link;
delete previous;
}
}