Need help with HybridList class errors......
I am in desperate need to figuring out why my program has 11 errors on line 191 and 1 error on line 130. If someone could please assist me, I would greatly appreciate your help.
Code:
//************************************************************
void HybridList::Print() const
// Postcondition:
// component members of all nodes (if any) in linked list
// have been output
{
mePtr currPtr = head; // Loop control pointer
while (currPtr != NULL)
{
cout << currPtr->lName << endl; // Line 130 Error C2679
currPtr = currPtr->link;
}
}
//*************************************************************
void HybridList::Insert( /* in */ ComponentType item )
// Precondition:
// component members of list nodes are in ascending order
// && item is assigned
// Postcondition:
// New node containing item is in its proper place
// in linked list
// && component members of list nodes are in ascending order
{
mePtr currPtr; // Moving pointer
mePtr prevPtr; // Pointer to node before *currPtr
mePtr newMePtr; // Pointer to new node
// Set up node to be inserted
newMePtr = new me;
newMePtr->lName = item;
// Find previous insertion point
prevPtr = NULL;
currPtr = head;
while (currPtr != NULL && item > currPtr->lName) // Line 191 Error C2784
{
prevPtr = currPtr;
currPtr = currPtr->link;
}
// Insert new node
newMePtr->link = currPtr;
if (prevPtr == NULL)
head = newMePtr;
else
prevPtr->link = newMePtr;
}