【发布时间】:2011-08-18 09:13:55
【问题描述】:
我收到了这个错误: ==4024== 条件跳转或移动取决于未初始化的值 ==4024== 在 0x400D69:constructBoardSpaces(在 /a/fr-01/vol/home/stud/roniy02/oop/Ex3/Play)
功能是:
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]=' ';
}
}
}
}
不知道是什么问题。 谢谢
【问题讨论】:
-
如果您使用
-g标志进行编译,那么 Valgrind 将能够告诉您有问题的代码的确切行号。