Pointer to int array, passing and using it from another method
<p>I haven't cemented my learning of C++ arrays and have forgotten how to do this properly. I've done it with char array before but its not working as well for int array. </p>

<p>I declare a new blank int array:</p>

<pre><code>int myIntArray[10];
</code></pre>

<p>So this should be an array of nulls for the moment correct?</p>

<p>Then I assign a pointer to this array:</p>

<pre><code>int *pMyArray = myIntArray
</code></pre>

<p>Hopefully thats correct to there.</p>

<p>Then I pass this to another method elsewhere:</p>

<pre><code>anotherMethod(pMyArray)
</code></pre>

<p>where I want to assign this pointer to a local variable (this is where I'm really not sure):</p>

<pre><code>anotherMethod(int *pMyArray){    
    int myLocalArray[];    
    myLocalArray[0] = *pMyArray;    
}
</code></pre>

<p>I'm not getting any compilation errors but I'm not sure this is right on a few fronts. Any and all help and advice appreciated with this.</p>

<p>Edit:</p>

<p>I should have said what I am trying to do.</p>

<p>Very simple really, I'd just like to modify a local array from another method. </p>

<p>So I have:</p>

<p>Method 1 would contain: </p>

<p>int myArray1[10] = {0};</p>

<p>Method 2 would be passed the pointer to myArray:</p>

<p>Then some code to modify the variables in the array myArray. </p>
