Question: Consider the code snippet below: int main ( ) { Shape * shapes [ NUM _ OBJECTS ] ; shapes [ 0 ] = new
Consider the code snippet below:
int main
Shape shapesNUMOBJECTS;
shapes new Circle;
shapes new Rectangle;
shapes new Circle;
shapes new Rectangle;
for int i ; i NUMOBJECTS; i
shapesidrawdrawarea;
for int i ; i NUMOBJECTS; i
delete shapesi;
In order for pointers to the two different objects Circle and Rectangle to be put into the same array shapes what must be true?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
