// Practice17.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class base{private: int i;public: base(int a) { i = a; } void show() { cout << i << endl; }};class derived :public base{private: base d;public: derived(int i) :base(i) { d(i); } void show(){ base::show(); }};int _tmain(int argc, _TCHAR* argv[]){ derived obj(100); obj.show(); system("pause"); return 0;}
目前暂无任何回答
- 0 回答
- 0 关注
- 779 浏览
添加回答
举报
0/150
提交
取消