单选题
有如下程序: #include
using namespace std; class Point{ public: Point(int xx=0,int yy=0):x(xx),y(yy) { } void SetXY(int xx,int yy) { x=xx; y=yy; } protected: int x,y; }; class Circle:Point{ public: Circle(int r):radius(r) { } void Set(int r,int x,int y) { radius=r; SetXY(x,y); } //① void Print() const { cout<
A、
①
B、
②
C、
③
D、
④
【正确答案】
C
【答案解析】
解析:C选项中SetXY为基类的成员函数,派生类也继承下来,但是SetXY的参数为两个,而③调用时是3个参数,所以错误。
提交答案
关闭