Question OOP-POLY-0068
HardHow does a vtable make virtual calls work in C++?
- A.
Each object stores copies of its functions
- B.
The compiler inlines every virtual call
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Polymorphism question
How does a vtable make virtual calls work in C++?
Each object stores copies of its functions
The compiler inlines every virtual call
Sign up free to see the answer and a step-by-step explanation.
Each polymorphic object holds a pointer to its class's table of function addresses, which the call looks up
The program searches all classes at run time