I am trying to initialize a two-dimensional array to 0. Here is my code for the function.
I keep getting an error telling me I am re-initializing the array. I need to set the array magic[25][25] = 0.
Here is my code. The help would be greatly appreciated.
void magicSquare( int size, int magic[25][25])
{
/*local definitions*/
int row = 0;
int col = size / 2;
int c;
int magic[25][25] = {0};
magic[row][col] = 1;
for(c=2; c <= size * size; c++)
{
row --;
col++;
if(aboveTop(row,col,size))
row = size - 1;
if(outRight(row,col,size))
col = 0;
if(filledSquare(row, col, size))
col = size - 1;
}magic[row][col] = c;
return;
}