Question
Using C++ Create an Array project to include: 1. Define a pointer to a double, pdArray . 2. Assign the pointer, pdArray , to contain
Using C++ Create an Array project to include: 1. Define a pointer to a double, pdArray. 2. Assign the pointer, pdArray, to contain the address of the double array, dArr: 3. Use the array name, dArr, to print out the array elements with subscript notation, [ ]. All on 1 line a space between each. 4. Use the pointer to print out the array elements with pointer notation while not changing the pointer itself. Use a for loop. *( pdArray + Cnt1) would be an example. All on 1 line a space between each. 5. Use the pointer to print out the array elements with pointer notation but change the pointer to point to the actual array element rather than the method in 18. All on 1 line. *pdArray would do this if the loop has the following post loop operation: pdArray++ 6. Use the array name for the double array and pointer notation to print the entire array, all on one line. 7. Using a different pointer, piArray, allocate enough memory for 100 int's and assign the address to the pointer. 8. In a for loop assign every item in the array to be a random number from 1 to 49 ( hint: rand() % 6 + 1 gives random numbers from 1 to 6 ) 9. Using cout print the first 10 items in the array, all on 1 line.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started