C - subscripted value is neither array nor pointer nor vector
<p>I declared an array and pass a 2D array as a parameter. However I keep getting the same error: subscripted value is neither array nor pointer nor vector. 
for this line: vertex[i][j-1] = shape[i][j];</p>

<p>How can I solve it?</p>

<p>header file:</p>

<pre><code>GLfloat mijnplayer [][4] ={
{0,-0.091057,0.198079,0.084590},
{0,-0.158043,0.158043,0.071039},
{0,-0.071039,0.158043,0.158043}};
</code></pre>

<p>function call:</p>

<pre><code>int main(void)
{   

drawVertex(mijnplayer,3,1);

}

void drawVertex(GLfloat shape[][4], int numberVertex, int shape)
{
    int i,j;
    GLfloat vertex[][3]={0};


    //convert 4element array to 3 element array
    for(i=0;i&lt;numberVertex;i++)
    {
        for(j=1;j&lt;4;j++)
        {
            vertex[i][j-1] = shape[i][j];
        }

    }

    for(i=0;i&lt;numberVertex;i++)
    {

        glVertex3fv(vertex[i]);
    }

}
</code></pre>

<p>EDIT:</p>

<p>the complete compiler output: </p>

<p>cc    -c -o mijnTest.o mijnTest.c</p>

<p>mijnTest.c:23:59: error: conflicting types for ‘shape’</p>

<p>void drawVertex(GLfloat shape[][4], int numberVertex, int shape)
                                                           ^</p>

<p>mijnTest.c:23:25: note: previous definition of ‘shape’ was here</p>

<p>void drawVertex(GLfloat shape[][4], int numberVertex, int shape)
                         ^</p>

<p>mijnTest.c: In function ‘drawVertex’:</p>

<p>mijnTest.c:43:26: error: subscripted value is neither array nor pointer nor 
vector</p>

<p>vertex[i][j-1] = shape[i][j];
                          ^</p>

<p>mijnTest.c: In function ‘drawScene’:</p>

<p>mijnTest.c:69:2: warning: passing argument 1 of ‘drawVertex’ from 
incompatible pointer type [enabled by default]</p>

<p>drawVertex(assen,6,0);
  ^</p>

<p>mijnTest.c:23:6: note: expected ‘GLfloat (<em>)[4]’ but argument is of type 
‘GLfloat (</em>)[3]’</p>

<p>void drawVertex(GLfloat shape[][4], int numberVertex, int shape)
      ^</p>

<p>make: *** [mijnTest.o] Error 1</p>