示例: #include<iostream> using namespace std; class A { public: int a; int b; A(int aa=1, int bb=2):a(aa),b(bb) {} }; class B :public A { public: B(int a=3,int b=4,int c=5,int d=6):A(a,b),d(c),g(d) {} int d; int g; }; void f(A* p,int n) { for (int i =…