C++ Programmer Question:
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;
};
Previous Question | Next Question |
Explain void free (void* ptr)? | Tell me what will the line of code below print out and why? |