Answer Posted / atul jawale
Virtual base class is a base class acts as an indirect base
for more than one without duplication of its data members.
A single copy of its data members is shared by all the base
classes that use it as a virtual base.
For example:
A
/ \
B C
\ /
D
class A { /* ... */ }; // indirect base class
class B : virtual public A { /* ... */ };
class C : virtual public A { /* ... */ };
class D : public B, public C { /* ... */ }; // valid
Using the keyword virtual in this example ensures that an
object of class D inherits only one subobject of class A.
| Is This Answer Correct ? | 75 Yes | 7 No |
Post New Answer View All Answers
Explain the isa and hasa class relationships.
Can I uninstall microsoft c++ redistributable?
What does std :: flush do?
Write about the stack unwinding?
What do manipulators do?
What is the full form of ios?
Why is "using namespace std;" considered bad practice?
What does ctime() do?
What is property in oops?
describe private access specifiers?
Explain what are mutator methods in c++?
What is istream and ostream in c++?
When one must use recursion function? Mention what happens when recursion functions are declared inline?
What is abstraction oop?
C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.