#include #include using namespace std; class complex_base { float re, im; public: float real() { return re; } void real(float rr) { re=rr; } float img() { return im; } void img(float ii) { im=ii; } void print() const { cout << re << ",j" << im; } }; int main() { shared_ptr x(new complex_base); x->real(143); x->img(-24); shared_ptr y(new complex_base); y=x; y->print(); return 1; }