Hi ,
I have a big problem with operator overloading.. The question is
Design a class to represent complex numbers with operator overloading redifining +,-,* and == to perform revelant function on the complex numbers.. I have done a bit but i dont knoe further Please help me.......
# include <iostream.h>
# include <conio.h>
class complex {
private:
int r,i;
public:
accept()
{
cin>>r>>i;
}
complex operator +()
{
int sumr,sumi;
sumr=a.r+b.r;
sumi=a.i+b.i;
cout<<" The addes result is ";
cout<<sumr<<" "<<sumi<<"i";
}
};
void main()
{
clrscr();
complex a,b;
a.accept();
b.accept();
a+b;
}
This one is for only + but still doesent work.....
Dont say that i am asking you guys to do my home work.. I tried my level best but couldnt.. I have to submit it tommorow...
....