 <pre><code>2751995 &lt;-- address of identidade[0][0] 2751998 &lt;-- address of identidade[1][0] 2752001 &lt;-- address of identidade[2][0] 2752004 &lt;-- address of ctbh[0][0] 2752007 &lt;-- address of ctbh[1][0] 2752010 &lt;-- address of ctbh[2][0] 2752013 &lt;-- address of ctbah[0][0] 2752016 &lt;-- address of ctbah[1][0] 2752019 &lt;-- address of ctbah[2][0] </code></pre> <p>The addresses increase by three (within each <code>matriz3</code>) because you are iterating over the first dimension of each <code>matriz3</code>, not the second, like going down the leftmost column of a table without iterating along the rows. (The increment is steady when jumping from one <code>matriz3</code> to the next, because they occupy neighboring memory, because of the way you declared them and luck.)</p> <p>It is not clear what you are trying to do, but if you want to iterate over all elements, you must add a third nested loop-- because a <code>matriz4</code> is three-dimensional.</p>