-
June 25th, 2002, 04:01 PM
#1
problems with overloading the operator +
Hi,I am trying to add two objects of a class into a third one of the same class
for instance if class name kota and object name would be
kota A,B;
C=A+B;
but i am writting this to the kota.h
kota operator+(kota SA_1,kota SA_2);
and in the kota.cpp
kota kota:perator+(kota SA_1,kota SA_2)
{ kota C;
return C;
}
don't mind the rest of the algorithm the problem is that the compiler shows that
c:\windows\desktop\13331.rar\kota.h(23) : error C2804: binary 'operator +' has too many parameters
Error executing cll.exe.
Creating browse info file...
application.exe - 1 error(s), 0 warning(s)
please help otherwise how can i write so i can add the A+B(some values of them to C)
thanks.
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
|