C++ Programmer Question:
Download Job Interview Questions and Answers PDF
Tell me how to create a pure virtual function?
Answer:
A function is made as pure virtual function by the using a specific signature, " = 0" appended to the function declaration as given below,
class SymmetricShape {
public:
// draw() is a pure virtual function.
virtual void draw() = 0;
};
class SymmetricShape {
public:
// draw() is a pure virtual function.
virtual void draw() = 0;
};
Download C++ Programmer Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain void free (void* ptr)? | Tell me what will the line of code below print out and why? |