Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2341130
  • 博文数量: 816
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5010
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-17 17:57
文章分类

全部博文(816)

文章存档

2011年(1)

2008年(815)

分类:

2008-12-17 18:08:10

#include
class BaseClass {
public:
int DataValue;
BaseClass(int a)
{
DataValue=a;
}
~BaseClass(){}
};
class DerivedClass1 : public BaseClass
{public:
DerivedClass1(int xx):BaseClass(xx){}
};
class DerivedClass2 : public BaseClass {
public:
DerivedClass2 (int yy):BaseClass(yy){}
};
class MultipeClass1: public DerivedClass1, public DerivedClass2
{
public:
    MultipeClass1(int x,int y):DerivedClass1(x), DerivedClass2 (y){cout<};

void main( )
{
MultipeClass1 A(100,200);
cout<cout<
}
class DerivedClass3 : virtual public BaseClass {
public:
int a;
DerivedClass3(int xx):BaseClass(xx){a=xx;}
};
class DerivedClass4 : virtual public BaseClass {
public:
DerivedClass4 (int yy):BaseClass(yy){}
};
class MultipleClass2: virtual public DerivedClass3,virtual public DerivedClass4 {
public:
MultipleClass2( int x,int y):DerivedClass3(x),DerivedClass4 (y){cout<<""<};
void main3( ){
MultipleClass2 A(100,200);
cout< cout<
 }


--------------------next---------------------

阅读(1101) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~