title: Does the size of a pointer to an array matter when passed as a parameter to a function
body: <p>Does the size of the parameter arr[] (which is a pointer to an array) matter? I know arr[] is treated as a pointer, does it matter if you put a value in between those brackets? If so why? If not why? </p>
  
  <p>Why is arr[] treated as a pointer? Can it be re-written as int *arr (with no brackets)?</p>
  
  <p>I know the parameter size can take any value, but what about the pointer (int arr[]) pointing to an array?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  // function declaration:
  double getAverage(int arr[], int size);
  
  int main () {
     // an int array with 5 elements.
     int balance[5] = {1000, 2, 3, 17, 50};
     double avg;
  
     // pass pointer to the array as an argument.
     avg = getAverage( balance, 5 ) ;
  
     // output the returned value 
     cout &lt;&lt; "Average value is: " &lt;&lt; avg &lt;&lt; endl; 
  
     return 0;
  }
  </code></pre>