title: C++ Error C3078 cannot 'new' an array of unknown bounds
body: <p>Hi I'm new to programming and struggling with these application. Here is the error code:</p>
  
  <blockquote>
    <p>Error  C3078   you cannot 'new' an array of unknown bounds line 17</p>
  </blockquote>
  
  <p>I am struggling to understand and grasp the concept of pointers. Any help is great thanks for looking at my code.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;;
  using namespace std;
  
  //function prototypes
  int getArray(int num);
  void selectionsortArray(int *[], int);
  double findAverage(int *scores, int nums);
  void showSortedArray(int *[], int);
  
  int main()
  {
  int *scores = new int[]; // To dynamically allocate an array
  
  double total = 0, //accumulator
          average; //to hold average test scores
  
  int testScores, // To hold the amount of test scores the user will enter
      count; //Counter variable
  
  // Request the amount of test scores the user would like to enter
  cout &lt;&lt; "How many test scores do you wish to process: ";
  cin &gt;&gt; testScores;
  
  getArray(testScores);
  
  selectionsortArray(&amp;scores, testScores);
  
  cout &lt;&lt; "Test scores sorted:\n\n";
  showSortedArray(&amp;scores, testScores);
  
  average = findAverage(scores, testScores);
  
  //set precision
  cout &lt;&lt; setprecision(2) &lt;&lt; fixed;
  cout &lt;&lt; "\tAverage Score\n";
  cout &lt;&lt; average;
  
  
  
  
  
  
  }
  
  int getArray(int num)
  {
  int *array, ptr; //set array pointer equal to 0
  int count;
  
  cout &lt;&lt; "\tPlease enter Test Scores by percent:\n";
  for (count = 0; count &lt; num; count++)
  {
      cout &lt;&lt; "Test score #" &lt;&lt; (count+1)&lt;&lt; ": ";
      cin &gt;&gt; array[count];
  }
  
  ptr = *array; //Set the ptr to be returned with the array
  
  return ptr; // return ptr
  }
  
  void selectionsortArray(int *arr[], int testScores)
  {
  int startscan, minIndex;
  int *minElem;
  
  for (startscan = 0; startscan &lt; (testScores - 1); startscan++) 
  {
      minIndex = startscan;
      minElem = arr[startscan];
      for(int index = startscan + 1; index &lt; testScores; index++)
      {
          if (*(arr[index]) &lt; *minElem)
          {
              minElem = arr[index];
              minIndex = index;
          }
      }
      arr[minIndex] = arr[startscan];
      arr[startscan] = minElem;
  }
  }
  
  void showSortedArray(int *arr[], int testScores)
  {
  for ( int count = 0; count &lt; testScores; count ++)
      cout &lt;&lt; *(arr[count]) &lt;&lt; " \n";
  }
  
  double findAverage(int *scores, int testScores)
  {
  double average = 0;
  
  for (int count = 0; count &lt; testScores; count++)
      average += scores[count];
  
  average /= testScores;
  
  return average;
  }
  </code></pre>