title: What is useful about a reference-to-array parameter?
body: <p>I recently found some code like this:</p>
  
  <pre><code>typedef int TenInts[10];
  void foo(TenInts &amp;arr);
  </code></pre>
  
  <p>What can you do in the body of <code>foo()</code> that is useful, that you could not do if the declaration was:</p>
  
  <pre><code>void foo(int *arr);    // or,
  void foo(int arr[]);   // or,
  void foo(int arr[10]); // ?
  </code></pre>
  
  <p>I found a question that asks <a href="https://stackoverflow.com/questions/404232/how-do-i-pass-a-reference-to-a-two-dimensional-array-to-a-function"><strong>how</strong> to pass a reference to an array</a>.  I guess I am asking <strong>why</strong>.</p>
  
  <p>Also, only <a href="https://stackoverflow.com/questions/2038229/when-is-pointer-to-array-useful/2042598#2042598">one answer</a> to "When is pointer to array useful?" discussed function parameters, so I don't think this is a duplicate question.</p>