⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 4-1.txt

📁 思路很清晰的c++课件。例子很简明
💻 TXT
字号:
#include <iostream.h>

class base{		//基类
	int x;
public:
	void setx(int n){x=n;}
	void showx(){cout<<x<<endl;}
};

class derived:private base{		//私有派生类
	int y;
public:
	void setxy(int n,int m)
	{  setx(n);
	   y=m;
	}
	void showxy()
	{  cout<<x<<y<<endl;		//?
	}
};

void main()
{
	derived obj;
	obj.setxy(10,20);
	obj.showxy();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -