#include #include class complex{ public: //constructors complex(); //complex:real(0.0),im(0.0){;} inline complex (float, float); complex(const complex &); //destructor ~complex(); //setters void setval(float, float); float setreal(float); float setim(float); //getters float getreal() const {return real;} float getim() const {return im;} //binary operator overloading complex& operator= (const complex &); //asymmetric implementation of + //complex& operator+(const complex&); //implementation with a friend function friend complex operator+(const complex, const complex); void print() const; static int init_counter(); static int count(); private: float real, im; static int counter_; }; //define static members before any function can use them int complex::counter_= 0; /* complex::complex(){ real = 0; im = 0; } */ complex::complex():real(0.0),im(0.0){counter_++;} complex::complex(float ii, float rr):real(rr),im(ii){counter_++;} complex::complex(const complex &c){ real = c.real; im = c.im; counter_++; } complex::~complex(){ //do nothing ; } void complex::setval(float rr, float ii){ real = rr; im = ii; std::cout<<"setval: real = "<