2022
08-16
08-16
一篇文章带你了解C++面向对象编程--继承
目录C++面向对象编程——继承总结C++面向对象编程——继承"Shape"基类classShape{public:Shape(){//构造函数cout<<"Shape->Constructor"<<endl;}~Shape(){//析构函数cout<<"Shape->Destructor"<<endl;}voidPerimeter(){//求Shape周长cout<<"Shape->Perimeter"<<endl;}voidArea(){//求Shape面积cout<<"Shape->Area"<<endl;}};"Circle"派生类"Circle"类继...
继续阅读 >