????I need to know if I am doing this program correctly from the instruction bel
ID: 3647827 • Letter: #
Question
????I need to know if I am doing this program correctly from the instruction below.????//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.
????Also I am receiving this error : Run - Time check failure # 3; The variable integer0fnumbers is being used without being initialized. Please help I have to turn this in tomorrow.
#include <iostream>
using namespace std;
int main ()
{
int *integerOfnumbers; //number to represent the integers
int size; //point to other arrays
cout << "How many elements do you have?";
cin >> *integerOfnumbers;
//Elements use to make the array
integerOfnumbers = new int [size];
// Populate number entered
for (int index = 0; index < size; index++)
{
cout << " Please enter a number:" << (index + 1)
<< " : ";
cin >> integerOfnumbers[index];
}
// Delete array when dynamically-allocate is done
delete [] integerOfnumbers;
integerOfnumbers = 0;
}