C++ Virtual Functions Question:

Download Job Interview Questions and Answers PDF

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

C++ Virtual Functions Interview Question
C++ Virtual Functions Interview Question

Answer:

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

Download C++ Virtual Functions Interview Questions And Answers PDF

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?