The Shape class

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

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