//Ava Huntington CS1A Chapter 9 Homework P. 537, #1
//
/*******************************************************************************
* CREATE ARRAY SIZE
* _____________________________________________________________________________
* This simple program will accept an integer value and create a dynamically
* allocated array sized to the chosen integer.
* _____________________________________________________________________________
* INPUT
* array: array created by program
* number of elements: given number of elements
*
* OUTPUT
* end array: array created with given number of elements
******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
double *array;
int numElms;
//Get number of elements in array
cout << "How many elements should be in this array?" << endl;
cin >> numElms;
//Dynamically allocate array
array = new double[numElms];
//Loop for number of elements.
for(int count = 0; count < numElms; count++)
cout << count +1 << endl;
// Free dynamically allocated memory
delete[] array;
return 0;
}