I'm trying to figure out what the compiler doesn't like about this:
enum { COLS = 10 };
void process_row( int arr2d[][COLS], int row, int arr[], int pickrow);
...
int a2d[][COLS] = { {1,2,3}, {4,5,6}, {7,8,9} };
I get a error: ISO C90 forbids mixed declarations and code on the a2d[][COLS] declaration. I tried looking up the error but I wasn't able to understand what is being mixed.
In the above, it should be creating
1 2 3 0 0 0 0 0 0 0
4 5 6 0 0 0 0 0 0 0
7 8 9 0 0 0 0 0 0 0
I thought it might be the symbolic constant, but it seems to be accepting it fine as a function parameter... what am I missing here?
This is compiled to conform with ansi-C.