题目内容

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

查看答案
更多问题

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

阅读下列程序,写出程序输出结果。#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'<

根据注释要求,仔细阅读下列程序并完善程序。#include#includeusing namespace std;class String{char *str;public:String(char *s){____;// 为指针str申请动态内存strcpy(str,s);}~String( ) { ____; }// 释放动态内存void print( ) { cout<

答案查题题库