C++ Virtual Functions Question:
Download Job Interview Questions and Answers PDF
Give example of a pure virtual function in C++?
Answer:
class SomeClass {
public:
virtual void pure_virtual() = 0; // a pure virtual function
// note that there is no function body
};
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 Question | Next Question |
Can you please explain the difference between using macro and inline functions? | Tell me can a pure virtual function have an implementation? |