so in main I have,
and I am overloading the -= operator in my bag.cpp file like this,Code:else if(user_input == 10){ x -= y; } else if(user_input == 11){ y -= x; }
Code:void bag::operator -=(const bag& minuend) { node *cursor; cursor = minuend.head_ptr->link(); while (cursor->link() != 0) { erase_one(cursor->data()); cursor = cursor->link(); } }
All of my other overloads are working but I have yet to figure this one out, maybe I need some sort of list searching algorithm for this? I have one of those that I could call from here but I am not sure how I could even use it in this situation. This is homework I have and it is due tonight... if something could give me a hint or something I would really appreciate it. Thanks!



LinkBack URL
About LinkBacks


