I got this error:
==4024== Conditional jump or move depends on uninitialised value(s)
==4024== at 0x400D69: constructBoardSpaces (in /a/fr-01/vol/home/stud/roniy02/oop/Ex3/Play)
and the function is:
static void constructBoardSpaces(char** array,int rows,int cols)
{
int i=0,j=0;
for (i = 0; i < rows; ++i)
{
for (j = 0; j < cols; ++j)
{
if((array[i][j])!='X'&&(array[i][j]!='O'))
{
array[i][j]=' ';
}
}
}
}
can’t figure out what is the problem.
Thanks
are you sure you initialized the two dimensional array before you enter that loop? Otherwise I would say the problem is probably in the if statement where you read from the array: