问题
单项选择题
有如下程序:
#include <iostream>
using namespace std;
class Baseprivate:
char c;
public:
Base(char n):c(n)
~Base()
cout<<c;
;
class Derived: public Baseprivate:
char c;
public:
Derived(char n):Base(n+1),c(n)
~Derived()
cout<<c;
;
int main() Derived obj(’x’);
return 0;
执行上面的程序将输出( )。
A.xy
B.yx
C.x
D.y
答案
参考答案:A