Which syntax declares a pure virtual function in a C++ class?
Correct answer B. virtual void draw() = 0;
Explanation
A pure virtual function is declared with the pure-specifier = 0 after the declarator. A class with at least one pure virtual function is abstract and cannot be instantiated; derived classes must override the function to become concrete. C++ has no abstract keyword, and = null or a pure keyword are not valid syntax.
Answer checked How we write and check questions
Discussion