单项选择题

为完成下面的程序,应在划线处填入的语句是
#include<iostream>
using namespace std;
class Base
{
private:
int x;
public:
Base(int i)
{
x=i;
}
~Base(){}
};
class Derived:public Base
{
public:
______ //完成类Derive构造函数的定义
};
int main()
{
Derived obj;
return 0;
}

A.Derived(int i):Base(i){}
B.Derived(){}
C.Void Derived (int i):Base(i){}
D.Denved(int i){Base(i);}
题目列表

你可能感兴趣的试题

微信扫码免费搜题