i am having error while running this code

```
negativenoinmatrix.c:10:16: error: subscripted value is neither array nor pointer nor vector
     if(z[i][j]<0)

```

i want to calculate the number of negative integers in a matrix 

```
#include <stdio.h>
int negnumbers(int *z, int n, int m)
{
    int count = 0;
    int i = 0;
    int j = m - 1;
    while (j >= 0 && i < n)
    {
        if (z[i][j] < 0)
        {
            count += (j + 1);
            i += 1;
        }
        else
            j -= -1;
    }
    return count;
}

int main()
{
    int n = 3, m = 4;
    int a[n][m];
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 4; j++)
            scanf("%d", &a[i][j]);
    }
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 4; j++)
            printf("%d ", a[i][j]);
        printf("\n");
    }
    int val = negnumbers((int *) a, 3, 4);
    printf("%d", val);
}

```