c++ two dimensional array definition
<p>What is wrong in below</p>

<pre><code>int data[2][2] = { {1,1}, {2,2}};
int sum = sum(data, 2);
</code></pre>

<p>Sum is defined as </p>

<pre><code>int sum(int **data, int rows);
</code></pre>

<p>data contains the address of the <code>data[0]</code>, so it can be treated as a pointer. The <code>*data</code> leads me to the value, which is another array of type <code>int</code>. This another array should be treated as pointer to first element. Hence why do compiler complains at the argument for int <code>**data</code>?</p>

<p>I get a compiler error as show below. I understand the error, but my question is why <code>**data</code> is not acceptable.</p>

<pre><code>error: cannot convert int (*)[2] to int** for argument 1 to int sum(int**, int)
</code></pre>
