~~~救救我的绣球花Hydrengea 迫切恳求。。 (转载)# gardening - 拈花惹草
c*e
1 楼
#include
using namespace std;
class A {
public:
A() { cout<virtual void f() { cout<};
class B: public A {
public:
B() { cout<virtual void f() { cout<};
int main()
{ B b; }
What is the output?
a) A_constructor A_f B_constructor A_f
b) A_constructor A_f B_constructor B_f
c) Cannot call f() in A's constructor
d) None of above.
using namespace std;
class A {
public:
A() { cout<virtual void f() { cout<};
class B: public A {
public:
B() { cout<virtual void f() { cout<};
int main()
{ B b; }
What is the output?
a) A_constructor A_f B_constructor A_f
b) A_constructor A_f B_constructor B_f
c) Cannot call f() in A's constructor
d) None of above.