不知道你要派生什么类,写了基本符合你要求吧#includeusingnamespacestd;classpoint{public:point():m_x(0),m_y(0){}point(intx,inty):m_x(x),m_y(y){}~point(){}friendpointoperator+(constpoint&p1,constpoint&p2);point&operator=(constpoint&p1);protected:doublem_x;doublem_y;};pointoperator+(constpoint&p1,constpoint&p2){pointp3;p3.m_x=p1.m_x+p2.m_x;p3.m_y=p1.m_y+p2.m_y;returnp3;}point&point::operator=(constpoint&p1){this->m_x=p1.m_x;this->m_y=p1.m_y;return*this;}intmain(){pointp1(1,2),p2(4,5);pointp3;p3=p1+p2;return0;}