2D array passing in C
<p><strong>How can I create an array so that I can pass it as a pointer to this function?</strong></p>

<pre><code>void SomeFunction(double *a, double *b, double *c);
</code></pre>

<p><strong>I made my 2d arrays like so (but I have errors):</strong></p>

<pre><code>static double matrix_a [MATRIX_DIM][MATRIX_DIM];
static double matrix_b [MATRIX_DIM][MATRIX_DIM];
static double matrix_c [MATRIX_DIM][MATRIX_DIM];

for (i=0;i&lt;MATRIX_DIM;i++) {
    for (j=0;j&lt;MATRIX_DIM;j++) {
        // initializing matrices here
    }
}
</code></pre>

<p><em>Now I make pointers to the arrays:</em></p>

<pre><code>double *a = &amp;matrix_a;
double *b = &amp;matrix_b;
double *c = &amp;matrix_c;
</code></pre>

<p><em>And then call the function:</em></p>

<pre><code>SomeFunction(a, b, c);
</code></pre>

<p>However I get the following error:</p>

<pre><code>cannons.c: In function ‘main’:
cannons.c:29:14: warning: initialization from incompatible pointer type      [enabled by default]
double *a = &amp;matrix_a;
              ^
cannons.c:30:14: warning: initialization from incompatible pointer type [enabled by default]
double *b = &amp;matrix_b;
              ^
cannons.c:31:14: warning: initialization from incompatible pointer type [enabled by default]
double *c = &amp;matrix_c;
              ^
</code></pre>

<p>Why ?</p>