What is Virtual Table?
Submitted by: AdministratorA virtual table is a mechanism to perform dynamic polymorphism i.e., run time binging. Virtual table is used to resolve the function calls at runtime. Every class that uses virtual functions is provided with its own virtual functions.
Every entry in the virtual table is a pointer that points to the derived function that is accessible by that class. A hidden pointer is added by a compiler to the base class which in turn calls *_vptr which is automatically set when an instance of the class is created and it points to the virtual table for that class..
Submitted by: Administrator
Every entry in the virtual table is a pointer that points to the derived function that is accessible by that class. A hidden pointer is added by a compiler to the base class which in turn calls *_vptr which is automatically set when an instance of the class is created and it points to the virtual table for that class..
Submitted by: Administrator
Read Online C++ Virtual Functions Job Interview Questions And Answers
Top C++ Virtual Functions Questions
☺ | Can you please explain the difference between using macro and inline functions? |
☺ | Explain polymorphism? |
☺ | Explain object slicing in C++? |
☺ | Explain data encapsulation? |
☺ | What is Object slicing? |
Top C Plus Plus Language Categories
☺ | C++ Pointers & Functions Interview Questions. |
☺ | C++ Operator Overloading Interview Questions. |
☺ | C++ Exception Handling Interview Questions. |
☺ | C++ Template Interview Questions. |
☺ | C++ Virtual Functions Interview Questions. |