Hi All,

I am learning c++, i am facing one problem adding the two objects , please help me How can i proced??


---------------------Code -------------------------------------------------------------------

#include<iosteream>

Using namespace std;

class Complex
{

double Real, imag;

public:

Complex()
{
Real = 0;
imag = 0;
}

Complex(double);
Complex(double, double);
};



void Complex :isplay()
{

cout << Real << "+i" << imag << "\n" ;;

}


Complex ::Complex(double aa)
{
Real = aa;
imag = 0;
}

Complex :: Complex( double aa, double bb)
{

Real = aa;
imag = bb;

}

void main()
{

Complex *p = NULL;

Complex *a = new Complex(2, 4);
Complex *b = new Complex(2, 4);

a->display();
b->display();


//p = a->operator +(b); // Here i am trying to add the complex number ??

}


Please how can add a and b complex number.

Thanks,
Anand