I am trying to remove an item in my link list. It does have 2 threads going threw it.
headByName and headByRating.
What i am trying to do is remove "cooper" from the list. how can i add headByRating below so it contains all the items as headByName.
list(void); // constructor
virtual ~list(void); // destructor
void displayByName(ostream& out) const;
void displayByRating(ostream& out) const;
void insert(const winery& winery);
winery * const find(const char * const name) const;
bool remove(const char * const name);
node(const winery& winery); // constructor
node * nextByName;
node * nextByRating;
node * headByName;
node * headByRating;
#endif // _LIST_
bool list::remove (const char * const name)
node * prev = NULL;
node * p = NULL;
node * curr = headByName;
if(strcmp(curr->item.getName(), name) == 0)
prev = headByName;
p = prev->nextByName;
headByName = p;
curr = curr->nextByName;
I think thats all the code you would need. I just dont know how to attach the headByRating in the list with headByname in the remove function?
cout << "\n>>> removing Cooper Mountain\n";