C++ Virtual Functions Question:

Give example of a pure virtual function in C++?

Tweet Share WhatsApp

Answer:

class SomeClass {
public:
virtual void pure_virtual() = 0; // a pure virtual function
// note that there is no function body
};

Download C++ Virtual Functions PDF Read All 30 C++ Virtual Functions Questions
Previous QuestionNext Question
Can you please explain the difference between using macro and inline functions?Tell me can a pure virtual function have an implementation?