...
Instead of having an array of objects, an array of pointers solves the problem of the objects being of different sizes. With the Base
and Derived
classes as abovein the Non-Compliant Code Example, we can define the walk
and main
methods as follows.
...