?? 7_4.cpp
字號:
#include<iostream.h>
class A
{
public:
A(int x);
~A();
protected:
int a;
};
A::A(int x)
{
a=x;
cout<<a<<"A";
}
A::~A()
{
cout<<a;
}
class B:public A
{
private:
int b;
int c;
const int d;
A m;
A n;
public:
B(int x);
~B();
};
B::B(int x):b(x),n(b+1),m(b+2),d(b+1),A(x+3)
{
c=x+2;
cout<<b<<c<<d;
cout<<"B"<<endl;
}
B::~B()
{
cout<<"C";
}
int main()
{
B s(0);
return(0);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -