【c++程序】多重继承
来源:互联网 发布:卷皮折扣淘宝网 编辑:程序博客网 时间:2024/05/09 19:21
#include<iostream>using namespace std;class father{public:void setA(int a){tall=a;}void printA(){cout<<"身高="<<tall<<endl;}private:int tall;};class mother{public:void setB(int a){weight=a;}void printB(){cout<<"体重="<<weight <<endl;}private:int weight;};class son:public father,public mother{private:int age;public:void setC(int c){age=c;}void printC(){printA(),printB(),cout<<"年龄="<<age<<endl;}};int main(){son a;a.setA(178);a.setB(60);a.setC(15);a.printC(); return 0;}
0 0
- 【c++程序】多重继承
- 【c++程序】多重继承
- (C++)多重继承
- C++--多重继承
- C++-继承:多重继承 && 虚拟继承
- C++【多重继承和虚继承】
- 走进C++程序世界------多重继承
- 【c++程序】多重继承容易产生两义性
- 第十二周程序填空-多重继承
- 第十二周 程序填空:多重继承
- 第11周-程序填空-多重继承
- 第12周 程序填空-多重继承
- 第十二周 程序填空-多重继承
- C++】多重继承,救世主还是鸡肋
- C++_Primer_chapter17 3.多重继承与虚继承
- 多重继承
- 多重继承
- 多重继承
- springMVC中获取页面参数的方法
- android 获取到的版本号一直显示为1.0 VersionName VersionCode
- 在Ubuntu上 用rvm安装Ruby 1.9.2的方法:
- :error: format not a string literal and no format arguments [-Werror=format-security]
- 求一元二次方程
- 【c++程序】多重继承
- python 2.5.4到python 3的函数变更情况
- java newInstance()和new Class()
- Everything s Okay
- sphinx配置
- hdu 1061打表
- springMVC+Aajx实现
- uva 10161 Ant on a Chessboard
- 北京航空航天大学计算机学院考博资料