在类的成员函数中可以由系统自动提供并隐含使用的指针名为____。
查看答案
阅读下列程序,写出程序输出结果。#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<
下列程序中类STR的功能是统计字符串中的单词数量。请完善程序。#include#includeusing namespace std;class STR{char *p;int c;public:STR(char *s1=0){c=0;if (s1){p=____; // 初始化成员指针pstrcpy(p, s1);}elsep=0;}~STR( ) { if(p) ____; }void print( ){cout<