尝试编译C时编译错误

时间:2014-08-31 02:11:55

标签: c

代码:

enum cell_contents checkMove[8][8];

错误:

warning: passing argument 2 of ‘test_for_winner’ from incompatible pointer type [enabled 
by default]
test_for_winner(&playerCurrent, &checkMove[8][8]);

note: expected ‘enum cell_contents (*)[8]’ but argument is of type ‘enum cell_contents *’
BOOLEAN test_for_winner(struct player * next_player,

我是C编程的新手。我在这里做错了什么?

编辑 - 测试获胜者代码

BOOLEAN test_for_winner(struct player * next_player, enum cell_contents board[][BOARDWIDTH])
{
    BOOLEAN has_moves = TRUE;
    return has_moves;
}

1 个答案:

答案 0 :(得分:0)

我通过将函数调用更改为:

来解决问题
test_for_winner(&playerCurrent, checkMove);