Multiple choice technology programming languages

The vtable entry for a pure virtual function in C++ is

  1. zero

  2. NULL

  3. one

  4. No Entry in vtable

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Compilers typically set the vtable entry for a pure virtual function to NULL. This ensures that attempting to call a pure virtual function directly (without overriding) results in a predictable error. The NULL entry indicates no implementation is available in this class. Abstract classes cannot be instantiated precisely because they have such NULL vtable entries.