Question: Create a structure called shapes. It should have a count of the number of rectangles it contins, and it should have a rectangle pointer that
Create a structure called shapes. It should have a count of the number of rectangles it contins, and it should have a rectangle pointer that will point to an array of rectangles.
After you create the shapes structure with new initialize the count to a value (read in from cin or a file). Then create an array of rectangle structures.
The rectangle structure needs two unsigned int values length and width. Initialize these two values for each of the rectangle structures in the array of rectangle structures. Again read in the values from cin or from a file.
Finish your work by printing out the contents of the array of rectangle structures.
Try and make sure you use all of the following:
Pointer operator ->
Use indirection operator *
Use subscripts on the dynamically created array (perhaps use when initializing)
Use pointer arithmetic for the dynamically created array (perhaps use when printing)
c++ programming problem
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
