C++??????????????
???????????? ???????[ 2015/7/30 10:47:50 ] ??????????????????? ????????
????C++??????????????????????
????(1)?κ?????????????????????????е??????
????(2)?κη?????????????????????????е??????
????(3)?κγ?????????????????????????????????
????(4)??????????????
#include <iostream>
using namespace std;
class OBJ1
{
public:
OBJ1(){ cout <<"OBJ1
"; }
};
class OBJ2
{
public:
OBJ2(){ cout <<"OBJ2
"; }
};
class Base1
{
public:
Base1(){ cout <<"Base1
"; }
};
class Base2
{
public:
Base2(){ cout <<"Base2
"; }
};
class Base3
{
public:
Base3(){ cout <<"Base3
"; }
};
class Base4
{
public:
Base4(){ cout <<"Base4
"; }
};
class Derived :public Base1?? virtual public Base2??
public Base3?? virtual public Base4
{
public:
Derived() :Base4()?? Base3()?? Base2()??
Base1()?? obj2()?? obj1()
{
cout <<"Derived ok.
";
}
protected:
OBJ1 obj1;
OBJ2 obj2;
};
int main()
{
Derived aa;
cout <<"This is ok.
";
int i;
cin >> i;
return 0;
}
?????????
????Base2
????Base4
????Base1
????Base3
????OBJ1
????OBJ2
????Derived ok.
????This is ok.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11