Colossusx10
n00b
- Joined
- May 19, 2007
- Messages
- 8
I wrote a function called Delete(), which is supposed to take in a name of a person, and delete it from the list. For some reason it doesn't work. When I try debugging it, I get that there is a problem here:
First of all, I don't know what that means. Second of all, I don't know what I'm doing wrong.
Here's the structure:
---------------------------------------------------------
Here's my function:
Can anyone see what is wrong with my function?
Any help would be appreciated.
Code:
return (compare(0, _Mysize, _Right._Myptr(), _Right.size()));
First of all, I don't know what that means. Second of all, I don't know what I'm doing wrong.
Here's the structure:
Code:
struct Air
{
string person;
Air *next;
};
Here's my function:
Code:
void JGOp::Delete()//Doesn't work
{
Air *previous;
Air *current;
string input;
cout << "Select person to delete: ";
cin >> input;
current = head;
previous = head;
current = previous->next;
while(current->person != input)
{
current = current->next;
previous = previous->next;
}
current->next=NULL;
previous->next = current->next;
delete current;
}//Deletepassenger
Can anyone see what is wrong with my function?
Any help would be appreciated.