How Virtual functions call up is maintained?
Answers were Sorted based on User's Feedback
Answer / ranjeet garodia
it is not look up table.
instead it is vtable.
every object has the vptr which locate the vtable in which
there is entries for the virtual functions.
so when calling the function it ucall the respective
function through vptr.
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / guest
By using Look up tables that were added by the compile to
every class image.
Is This Answer Correct ? | 0 Yes | 3 No |
Define what is constructor?
What does ios :: app do in c++?
What is insertion sorting?
What is purpose of abstract class?
How to tokenize a string in c++?
What are the two shift operators and what are their functions?
When can you tell that a memory leak will occur?
What is a c++ map?
Why is it called c++?
What are the extraction and insertion operators in c++?
class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { } }; Bar b; Referring to the above code, when the object 'b' is defined, a compiler error will occur. What action fixes the compiler error? a) Adding a virtual destructor to the class Bar b) Adding a constructor to Bar which takes an int parameter c) Adding "Foo()" to the Bar constructor d) Adding a copy constructor to the class Foo e) Adding "Foo(0)" to the Bar::Bar initializer list
Why c++ is the best language?