Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Problems with o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 9297 of 10094
Post > Topic >>

Problems with operators = and multiple +

by david <David.Abdurachmanov@[EMAIL PROTECTED] > Feb 19, 2008 at 04:43 PM

The code is located here:
http://www.paste.lt/paste/fafbd9fbfc71e25f12458aacf61aca8f

Before telling the problem I am now having and I would like to you
that there is still a lot of mistakes, missing parts, "const" words
and etc, but it works as it should be. I will make it better after I
will solve my problem.

So I have problem with = and + and even * (just wrote this part of
code) and I think I will be having in the future if I won't handle and
understand it now. The problem is in 352 line (there are two lines).
If I try to do like this: aaa + bbb + ccc it does work and returns new
intance of Aibe (not pointer or reference), aaa = bbb works just fine
too, it should make a deep copy of bbb (there still should be some
correction in code, like checking a = a, freeing memory of the first
one and etc.), but the code aaa = bbb + ccc + ... just does not work.
I am using gcc under Linux/Solaris/Mac OS X and I am getting this
error:

Macbook:pirma marius$ g++ -Wall -ansi -pedantic -o pirma pirma.cpp
pirma.cpp: In function 'int main(int, const char**)':
pirma.cpp:358: error: no match for 'operator=' in 'aaa =
Aibe::operator*(Aibe&)(((Aibe&)(& ccc)))'
pirma.cpp:238: note: candidates are: Aibe& Aibe::operator=(Aibe&)
pirma.cpp:359: error: no match for 'operator=' in 'aaa =
Aibe::operator
+(Aibe&)(((Aibe&)(& ddd)))'
pirma.cpp:238: note: candidates are: Aibe& Aibe::operator=(Aibe&)

Could someone help with this?
It looks that I made some mistakes declarating operators or there is
some problems with returning types.

P.S. Sorry for making mistakes, too tired to make something correct.

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 2 Posts in Topic:
Problems with operators = and multiple +
david <David.Abdurachm  2008-02-19 16:43:32 
Re: Problems with operators = and multiple +
Joshua Lehrer <usenet_  2008-02-19 23:43:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 18:23:59 CDT 2008.