|
-
December 30th, 2010, 09:56 AM
#8
Re: overload
1. I see a "new" , but no delete. You will have a memory leak
2. You do memory allocation. You will need to code up a proper
copy constructor and assignment operator
3. Normally, you do not make operator + a member variable.
You make operator += a member (returning a reference to *this
4. You make operator + a non member function, coded in terms
of operator += and the copy constructor.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|