In the following program, how many times Base’s constructor will be called?

#include <iostream>
 
using namespace std;
 
class Base
{
    int static i;
public:
    Base() { cout << "Base's constructor"; };
};
 
class Sub1 : public virtual Base {};
class Sub2 : public Base {};
class Multi : public Sub1, public Sub2 {};
 
void main()
{
    Multi m;
    system("pause");
}

 

Suy nghĩ trả lời câu hỏi trước khi xem đáp án

ATNETWORK
ZUNIA9