Pass a reference to an array
<p>Considering I have the following array:</p>

<pre><code>int * a = new int[1000];
</code></pre>

<p>I would like to pass this array to a function by reference. If I would be calling this function from <code>main</code>:</p>

<pre><code>int main()
{
    int * a = new int[1000];
    func(a);
    //print the elements of the array
    for(int i=1;i&lt;=sizeof(a);i++) cout&lt;&lt;a[i]&lt;&lt;" ";
    return 0;
}
</code></pre>

<p>My function would be:</p>

<pre><code>void func( ??? )
{
//write some elements in the array
for(int i=1;i&lt;=sizeof(a);i++) a[i]=i;
}
</code></pre>

<p>How do I have to declare <code>func</code>?</p>