![]() |
|
#1
|
|||
|
|||
Help with some functionsI need help writing a few functions. I'm haveing difficulties with them functions: bag bag::operator=(const bag& b), bool bag::operator==(const bag& b), bool bag::erase(const value_type& target).
Thank you for any help. CPP / C++ / C Code:
CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
Re: help with some functionsIs my question too abstract or too difficult to answer?
|
|
#3
|
||||
|
||||
Re: help with some functionsFor the == operator, compare each variable in the two objects. For example:
CPP / C++ / C Code:
Of course, that only works if you've overloaded the == operator for the Node class and every other class you're comparing. As for the = operator, why would it be any different from the copy constructor? BTW, does "head = tail = current = NULL;" actually work? I thought I tried it in one of my programs and received an error. __________________
Gamer_2k4 |
|
#4
|
|||
|
|||
Re: help with some functionsQuote:
Assuming that they are all the same data type, yes. Now for the OP questions. I encounter this problem alot with people that I work with. Lets do an example: CPP / C++ / C Code:
gamer_2k4 already hit on the other one, and go ahead and try the last one and let us know what you get. |
Recent GIDBlog
Compress Your Web Site by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows C++ Problem with Class and Functions | Alloishus | C++ Forum | 3 | 28-Sep-2006 18:34 |
| friend functions error | CaptnB | C++ Forum | 2 | 12-Jun-2006 13:39 |
| Please help with functions... | brookeville | C++ Forum | 36 | 05-Nov-2004 00:23 |
| conflict between printf and stdarg.h va functions | mirizar | C Programming Language | 3 | 12-Jul-2004 08:11 |
| Understanding functions | tommy69 | C Programming Language | 15 | 15-Mar-2004 17:59 |
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The