正在加载图片...
第二节单繼承的派生类 (教材①203-219) #includesiostream> using namespace std class Base∥基类Base的定义 i private float x, y; public: Base(float a=0, float b=0) {x=a;y=b;} void print(void) i cout<<x=<<x<<ny=<<y<<end;)第二节 单继承的派生类 (教材①203-219) #include<iostream> using namespace std; class Base //基类Base的定义 { private: float x,y; public: Base(float a=0,float b=0) {x=a;y=b;} void print(void) { cout<<"x="<<x<<"\ny="<<y<<endl;} };
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有