I assume that you are using the C99 compiler (with support for arrays with dynamic size). The problem in your code is that at the moment when the compilers see your variable declaration, it cannot know how many elements are in the array (I also assume here, from the compiler error, that length not a compile-time constant)
You must manually initialize this array:
int boardAux[length][length]; memset( boardAux, 0, length*length*sizeof(int) );
David Rodríguez - dribeas Jun 21 2018-10-10T00: 00Z
source share