Vtables

Options
- creates a static table per class
- creates a static table per object
- creates a dynamic table per class
- creates a dynamic table per object


CORRECT ANSWER : creates a static table per class

Discussion Board
vtable is not a c++ term

there is no term ''vtable'' in c++ standards. realization of virtual functions/etc is implementation-defined (it can be done without vtables)

Aaa 05-26-2018 08:51 AM

C++ - Vtables

Vtable stands for for Virtual Function Table. Vtables are used for virtual functions. It is a static table created by the compiler. Compiler creates a static table per class and the data consists on pointers to the virtual function definitions. They are automatically initialized by the compiler's constructor code. Since virtual function pointers are stored in each instance, the compiler is enabled to call the correct virtual function at runtime.

Prajakta Pandit 01-24-2017 01:04 AM

exam

can you tell me somebody what are the exams for c++ professionals ?

Dean 06-2-2015 07:10 AM

c,c++,ds

by the process we can understand many things which still we dont know so its usefull.i need more question to practice.

priyanka patra 02-19-2015 03:58 PM

Vtable

Vtable only created by compiler for a class. When a class having a virtual function or overriding a virtual function. that time compiler creates vtable and vpointer.

Sonu 09-24-2014 03:05 AM

Vtable

Did I understand this correctly. Is the question incomplete. "Whenever a class itself contains virtual functions or overrides virtual functions from a parent class the compiler builds a vtable for that class. This means that not all classes have a vtable created for them by the compiler". My point is that not all classes have a vtable.

Steve 02-6-2014 05:09 AM

Write your comments

 
   
 
 

Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement