I was trying to test some things out on an online compiler regarding arrays. I have been having an error that states that my array is variably modified. How do I initialize the array while still having variables inside the array that I can use within my cells? Am I on the right path with the use of isSetup. A friend gave me that advice. How would you go about this. The exact error happened when I defined my global array int myrowcol[col][row];
at line 3.
int row;
int col;
int myrowcol[col][row];
int const team = 1;
int rowmux;
void main()
{
if (isSetup == 0)
{
row = 7;
col = 7;
myrowcol[row][col];
isSetup = 1;
}
for (int i = 0; i < 64; i ++)
{
for (int col = 7; col > 0; col--)
{
for (int row = 7; row > 0; row--)
{
if (myrowcol[col][row - 1] == 1 || row == 0)
{
myrowcol[col][row] = team;
}
}
}
}
}