Please help me with fixing [x] I am receiving a respond that it is undefined. Al
ID: 3647795 • Letter: P
Question
Please help me with fixing [x] I am receiving a respond that it is undefined.Also am I following the instruction. I am just not sure.
//Write a function that dynmamically allocates an array of integers. The function should accept an intergers argument indicating the
//number of elements to allocate. The function should return a pointer to the array..
#include <iostream>
using namespace std;
int main ()
{
int numbers; //number to represent the integers
int* arrays = NULL; //point to other arrays
cout << "Enter the number of elements:";
cin >> *arrays;
arrays = new int[numbers]; //Memory allocation
for (int x = 0; x < numbers; x++)
cout << "Enter a number to represent child age:"<< endl;
cin >> *arrays[x];
delete [] arrays;
return 0;
}