Question: need the code C++ Asap - The statement in Line 1 declares intList to be a pointer of type int. - The statement in Line

- The statement in Line 1 declares intList to be a pointer of type int. - The statement in Line 2 declares arraysize to be an int variable. - The statement in Line 3 prompts the user to enter the size of the array - The statement in Line 4 inputs the array size into the variable arraysize. - The statement in Line 6 creates an array of the size specified by arraysize, and the base address of the array is stored in intList. In this lab, you will do the following (You may use the above excerpt of code for guidance): 1) Allocate memory for a dynamic array of integers at run time. 2) Prompt the user for the size of the array, then using the new operator allocate the memory to the array. 3) Populate the elements of the array with integers that correspond to the array index, e.g. a[0] =0, a[1] =1; etc. 4) Display the array contents on the screen. 5) Return the allocated memory to the heap. 6) Exit the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
