填空题
若有int x[5],*p=x;则数组元素x[3]可以表示为*(p+
[8]
),也可以表示为p[3]。
【参考答案】
C
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
[9] 是一种特殊的成员函数,户主要用来为对象分配内存空间,对类的数据成员进行初始化并执行对象的其他内部管理操作。
点击查看答案
填空题
下列程序中,先声明一个圆类circle和一个桌子类table,另外声明一个圆桌类roundtable,它是由 circle和table两个类派生的,要求声明一个圆桌类对象,并输出圆桌的高度,面积和颜色。请填空完成程序 #include<iostream.h> #include<string.h> class circle double radius; public: circle(double r)radius=r; double get_area()return 3.416*radius*radius; ; class table double height; public: table(double h)<height=h; double get_height()return height; ; class roundtable:public table,public circle char *color; public: roundtable(double h,double r,char c[]): [10] color=new char[strlen(c) +1]; [11] ; ; char*get_color()return color; : void main() roundtable rt(0.8,1.0,“白色”); cout<< 圆桌的高: <<rt. get_height()<<end1; cout<< 圆桌面积: <<rt.get_area()<<end1; cout<< 圆桌颜色: <<n.get color()<<end1;
点击查看答案
相关试题
所有的函数模板定义都是以关键字 [15]...
如果要在类的对象上使用运算符,除了运算符...
派生类中所定义的虚函数的 [12] 不影...