Question: Consider the following C++ Code - Write a C++ code that outputs the contents of the array to which strPtr Points and deallocates the memory
Consider the following C++ Code
- Write a C++ code that outputs the contents of the array to which strPtr Points and deallocates the memory space occupied by the array to which strPtr points.
- Can you modify the code to use a different array size for strPtr? How would this affect the output of the program?

Q3 (30 points): Consider the following C++ Code (submit the complete code with output screenshot): \#include \#include > \#include using namespace std; int main() \{ string seasons[4] = \{"Winter", "Spring", "Summer", "Fall" }; string *strPtr; strPtr = new string[5]; //write the code a. Write a C++ code that outputs the contents of the array to which strPtr Points and deallocates the memory space occupied by the array to which strPtr points. b. Can you modify the code to use a different array size for strPtr? How would this affect the output of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
