class CBase
{
protected:
int m_anInt;
public:
CBase(int n): m_anInt(n) { cout < < "Base constructor\n"; }
virtual void Print() const = 0;
};
what sort of class is CBase and why? Derive a class from CBase that sets its inherited integer
value, m_anInt , when constructed, and prints it on request. Write a test program to verify that
your class is correct.
But the point is that CBase is abstract, which means that you cannot make an object from it. You can only create an object from a class which inherits from CBase. You know it's abstract because: virtualvoid Print() const = 0;
This says that any class which derives from CBase MUST provide a void Print() const function.