Pointer arithmetic to change array values
<p>This is a follow on question to an earlier one. </p>

<p>I have learned some errors of my ways, but have extra questions. My objective is to have a local array in one method changed from another method without the use of any global variables.</p>

<pre><code>void methodOne(){

        int myArray[10] = {0};
        int *pMyArray = myArray;

        methodTwo(&amp;*pMyArray);
}
</code></pre>

<p>This should be declaring an array of null values and passing a reference to the second array as I was shown how to do so correctly <a href="http://stackoverflow.com/questions/10283200/pointer-to-int-array-passing-and-using-it-from-another-method/10283358#10283358">here</a>.</p>

<pre><code>void methodTwo(int *passedPointer){

        int *localPointer =  passedPointer;

}
</code></pre>

<p>Next I'd like to change the values of myArray from methodTwo. So to change the first <code>[0]</code> element I would say:</p>

<pre><code>*localPointer  = 1;
</code></pre>

<p>Is this correct?</p>

<p>Then to change the next element would I increment the pointer using:</p>

<pre><code>localPoint++;
*localPointer = 2;
</code></pre>

<p>Would this change the second value in myArray? I'm not sure thats the correct way to do it is it? </p>

<p>TIA</p>
