gpt4 book ai didi

c - 这个程序有什么错误?

转载 作者:太空宇宙 更新时间:2023-11-04 05:58:54 24 4
gpt4 key购买 nike

这个程序有什么错误?

    int checkok(onesquare_board[5][5], int x, int y) {

if (board [x][y]. color != 0) {
printf("sorry, another piece here \n");
return 0; /*if this is true, then validmove will take the value 0*/
}
else {
return 1; /*if this is true, then validmove will take the value 1*/
}
}

出现的错误: 第一行的“['标记”之前的“预期')'”。

最佳答案

多个语法错误:

int checkok(onesquare_board[5][5], int x, int y) {
^^^^^^^^^^^^^^^--- no type given for array
if (board [x][y]. color != 0) {
^^^^^^---different variable name used

关于c - 这个程序有什么错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22336767/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com