Question: using C++ 1. Declare a variable p1 as a pointer to a double. Create a dynamic array of doubles of size 10 using 'new' to
using C++ 1. Declare a variable p1 as a pointer to a double. Create a dynamic array of doubles of size 10 using 'new' to allocate memory Save the address of the array in p1 */ 2. Using a for loop, assign to array location i the value 10*i. i.e., the array will end up with the following elements : {0, 10, 20, 30, 40, 50, 60, 70, 80, 90} */ 3. Declare a variable p2 as a pointer to a double Assign the address of the 4th element of the array p1, to p2 (i.e., p2 is going to have the address of the location where the value 30 is stored) Print the contents of the locations with address p2, p2+1, p2+2, and p2+3 (i.e., 4 values to be printed) */ 4. Change to -100 the content of the location p2 points to. Print the content of the array p1 (all 10 elements). */ 5. Deallocate (using delete) all the memory you created. */ 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
