C++ Accessing Successive Values in a 2D Array by Pointer
<p>I understand how to access elements in a 2D array by pointer, but I'm having a bit of trouble accessing the second "element" in an array row and using it to make comparisons. For example, if I had the array:</p>

<pre><code>int numbers[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
</code></pre>

<p>I would need to access the elements 2, 5, and 8 for another function. But when I declare a pointer and point it to the next element in an array, like so:</p>

<pre><code>int (*p)[3] = &amp;(numbers[1]);
</code></pre>

<p>or</p>

<pre><code>int (*p)[3] = numbers + 1;
</code></pre>

<p>It points to the next <em>element</em>, per se, being the next row in the array, since it's a 2D array. That I understand, but I was wondering if there was anything that could be done so that the pointer points to the next "element" in the current row, instead of pointing to the very next row?</p>