你老师要求的呀
授人以渔,不授人以鱼。
class fund { public: fund(){}; private: }; class motherfund: public fund { public: motherfund(double netvalue_) : netvalue(netvalue_) {}; private: double netvalue; }; class umbrellafund : public fund { public: umbrellafund(double netvalue_,double stockprice_) : netvalue(netvalue_),stockprice(stockprice_) {}; private: double netvalue; double stockprice; };