The Shape class

The Shape class contains two virtual functions - GetArea() and Draw(). The GetArea() function is also a pure virtual function. Hence Shape is an abstract base class, meaning you cannot instantiate it. The function prototypes are given as follows:

  1. virtual int GetArea() const = 0;
  2. virtual void Draw() const;
Apart from the above virtual functions, Shape class has a virtual destructor. Shape has no private data members.