// a simple complex class for playing with // stack array implementation // #include class Complex { public: double real() const {return _real;} double imag() const {return _imag;} void real (const double& r) {_real = r;} void imag (const double& i) {_imag = i;} Complex ():_real(0.0), _imag(0.0) {} Complex (const double& r) : _real(r) , _imag(0.0) { } Complex (const double& r, const double& i) : _real (r), _imag(i) { } Complex (const Complex& c) : _real (c.real()), _imag (c.imag()) { } Complex operator+ (const Complex& rhs) const; Complex& operator=(const Complex& rhs); friend ostream& operator<< (ostream& os, const Complex& c); private: double _real; double _imag; }; ////// Member function definitions ////////////////// Complex Complex::operator+ (const Complex& rhs) const { return Complex (_real + rhs.real(), _imag + rhs.imag()); } Complex& Complex::operator=(const Complex& rhs) { _real = rhs.real(); _imag = rhs._imag; return *this; } // overloaded output operator ostream& operator<< (ostream& os, const Complex& c) { os <