I am trying to delete a node from the linked list. Node has a name that user enters. But I couldn't figure out how can I ignore the uppercase/lowercase in while loop. Here is my code.
void del(string e)
{
temp=new node;
temp=head;
temp2=new node;
temp2=temp->next;
if(temp->info==e)
{
head=temp->next;
delete temp;
}
else
{
while(temp2->info!=e)
{
temp=temp->next;
temp2=temp2->next;
}
temp2=temp2->next;
temp->next=temp2;
}
}
And I get the string by this
cout<<"Enter the name to delete"<<endl;
ws(cin);
getline(cin,e);
del(e);
So is there any way to ignore uppercase/lowercase in while loop and if statement?