In my project there is a need to for multiple inheritances and I have figured out that i need to inherit base classes virtually. The code that I have works fine, but I would like to know in particular what happens internally during inheritance.
The classes that i use and the way they are inherited are as follows:
class A
{
public:
double a;
};
class B:virtual public A
{
public:
double b;
};
class C:virtual public A;
{
public:
double c;
void c1();
};
class D: public B, public C
{
public:
double d;
};
class E:virtual public A
{
public:
double e;
void c1();
};
class F:public B, public E
{
public:
double f;
};
class G
{
public:
double g;
};
class H:public G, public D, public F
{
public:
double h;
};
For the declaration of class H do i need to use the keyword 'virtual' before classes D and F? What are the variables contained in class H after inheriting D and F and how many instances of the same variables would be in H?
Thank you in advance