题目内容

下列关于new运算符的叙述中,不正确的是( )。

A. 使用运算符new创建对象时必须定义初始值
B. 使用运算符new创建对象时会调用类的构造函数
C. 运算符new可以用来动态创建对象和对象数组
D. 使用运算符new创建的对象可以使用运算符delete撤消

查看答案
更多问题

类的缺省访问特性是____,结构体的缺省访问特性是____。

在类的成员函数中可以由系统自动提供并隐含使用的指针名为____。

阅读下列程序,写出程序输出结果。#include using namespace std;class A{int a, b, c;public:A() { a=0; b=0; c=0; }A(int x, int y=2, int z=3) { a=x;b=y; c=z;}void Print( ) { cout<

阅读下列程序,写出程序输出结果。#include using namespace std;class A{int a;public:A(int x=0){a=x;cout<<"构造函数 A \n";}int get( ) { return a; }~A( ) { cout<<"析构函数 ~A \n";}};class B{int b;public:B(int x){b=x;cout<<"构造函数 B \n";}int get ( ) { return b; }~B( ) { cout<<"析构函数 ~B \n";}};class C{A a1, a2;B *p, b1;public:C(int x, int y, int z):b1(x), a1(y){cout<<"构造函数 C \n";p=new B(z);}void print( ){cout<get()<<'\t'<

答案查题题库