- 论坛徽章:
- 59
|
不行, 只能这样:
- #include<iostream>
- using namespace std;
- struct Base01{
- int m;
- Base01([color=Red]int am[/color]):m([color=Red]am[/color]){}
- void p(){cout<<m<<endl;}
- };
- struct Derived01:public Base01{
- Derived01():[color=Red]Base01[/color](3){}
- [color=Red] Derived01(int am):Base01(am);[/color]
- };
- struct Derived02:virtual public Base01{
- Derived01():Base01(4){}
- [color=Red] Derived02(int am):Base01(am);[/color]
- };
- struct my: Derived01,Derived02{
- my():[color=Red]Derived01(5),Derived02(5)[/color]{}
- };
- int main(){
- return 0;
- }
复制代码 |
|