第一章11.txt
来自「本书在复习C++基础知识后」· 文本 代码 · 共 30 行
TXT
30 行
#include <iostream.h>
class CRoot
{
public:
int small;
CRoot(int n = 2) { small = n;}
void showsmall(){ cout<<"small = "<<small<<endl; }
};
class CDer1: public CRoot
{
public:
CDer1(int m)
:CRoot(m)
{}
};
class CDer2: public CRoot
{
public:
int small;
CDer2(int n = 0) { small = n;}
};
int main()
{
CRoot A;
CDer1 B(3);
CDer2 C;
A.showsmall(); B.showsmall(); C.showsmall();
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?