title: How to pass array element by reference in c++?
body: <p>Is it possible to pass a single array element by reference (so that the argument passed in is modified)?
  For example, say this is a main part:</p>
  
  <pre><code>int ar[5] = {1,2,3,4,5};
  test(&amp;ar[2]);
  </code></pre>
  
  <p>And now this is the function definition:</p>
  
  <pre><code>void test(int &amp;p)
  {
      p = p + 10;
      return;
  }
  </code></pre>
  
  <p>The above code results in a compilation error.</p>