单选题:有如下程序: #include<iostream>using namespace std; class A{publi

  • 题目分类:C++
  • 题目类型:单选题
  • 查看权限:VIP
题目内容:
有如下程序:
#include<iostream>
using namespace std;
class A
{
public:
A(){cout<<”A”;}
-A(){cout<<”-A”;}
};
class B:public A
{
A*P;
public:
B(){cout<<”B”;P=new A();}
-B(){cout<<”~B”;delete p;}
};
int main()
{
B obj;
return 0;
}
执行这个程序的输出结果是( )。 A.BAA~A~B~A
B.ABA~B~A~A
C.BAA~B~A~A
D.ABA~A~B~A

参考答案:
答案解析:

有如下类声明: class SAMPLE {int n: public: SAMPLE(int i=0):n(i){

有如下类声明: class SAMPLE {int n: public: SAMPLE(int i=0):n(i){}void setValu

查看答案

有三个关系R、S和T如下. 由关系R和s通过运算得到关系T,则所使用的运算为( )。

有三个关系R、S和T如下. 由关系R和s通过运算得到关系T,则所使用的运算为( )。 A.并 B.自然连接 C.笛卡尔积 D.交

查看答案

B: What is important when…?Aiming to sell goods on the inte

B: What is important when…?Aiming to sell goods on the internet●Delivery tim

查看答案

In this part,the interlocutor asks questions to each of the

In this part,the interlocutor asks questions to each of the candidates in turn Y

查看答案

·You will hear another five recordings.·For each one decide

·You will hear another five recordings.·For each one decide what speakers are

查看答案