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::operator+(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.
it doesn't make any sense
i've tried both of those and it says the same thing again
Anyway this also what the C=A+B should do when it woulc be called through the main function
C.set(SA_2.exp_date.get_day(),SA_2.exp_date.get_month(),SA_2.exp_date.get_year());
//set(int,int,int);
i don't care about the algorithimic body i care about the compiler erros.
THanks for the help