//Question , how can I make the subscript point to the arraySize //The error is
ID: 3647831 • Letter: #
Question
//Question , how can I make the subscript point to the arraySize
//The error is in the for loop. (arraySize[count] && delete [] arraySize
//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 arraySize; // Holds the array memory
cout << "What is the size of ?";
cin >> arraySize; // point to the array
for (int count = 0; count < arraySize; count++)
{
arraySize[count] = 5*(count +1);
}
cout << " Size of the Array:" << endl;
for (int count = 0; count < arraySize; count++)
{
cout << arraySize[count] << endl;
}
delete [] arraySize;
return 0;
}