Hello everybody! I would like to ask a question about this code and some other questions related. I know this looks like a homework question but i just can't figure it out. I just have a few uncleritys.I dont understand the syntax.Can it be explained.I don't understand classes much. I know how class is defined and that it can have members but I don't understand inheritance and virtual. I dont know when the constructors are called or and when destructors should be called. What is public? Can somebody explain references to me? Upcasting is the problem.Can somebody explain constructor in code below?Cconstructor to class D that I have written.I appreciate your help.Thanks
This is the code.
class A {public A (int a) { } };
class B: virtual A { public: B (int c): A(0) {} };
class C: virtual A {public: c (bool b) : A(0) {} };
class D : B , C { }
The constructor written to class D is D ( ) : A(0) , B(0) ,C(true) {}