create a program that creates an array of 10 integers.the users will be able to enter thr data. create a second array that contains the addresses of the different values in the first array. list the values in the first array by using the array of pointers in the second array.
What have you learned so far? Have you written any programs? Have you looked at any program code? Did the place where you did find your "homework" have any explanation about "arrays" and "pointers"?
#include <iostream>
usingnamespace std;
int main(){
int arr[10];
int *pArr[10];
cout << "Enter 10 values into the array: \n\n\n";
// Asking the user to input the values int the integer;
cout << "Enter your first value: ";
cin >> arr[0];
for (int x = 0; x < 9; x++){
cout << "Enter another value: ";
cin >> arr[x+1];
}
//printing the array using its pointer;
cout <<endl<<endl;
for(int i= 0; i < 10; i++){
pArr[i] = &arr[i]; // storing the address of each arr element into pArr
cout << "The value of pArr["<<i<<"] is: " << *pArr[i]<<endl;
}
return 0;
}
if this isn't what you were talking about, paste a copy of the code you have worked on.