gpt4 book ai didi

c - 指针参数警告

转载 作者:行者123 更新时间:2023-11-30 20:34:36 26 4
gpt4 key购买 nike

我有以下错误:

GOL.c:49: warning: conflicting types for ‘calculatePos’

以下是与此事相关的代码:

void calculatePos(int **board, int x, int y) {
...
...
}

void nextGeneration(int **board) {
for(i=0; i<row; i++) {
for(j=0; j<col; j++) {
calculatePos(board, i, j);
}
}
}

int main() {
...
nextGeneration(board);
...
}

我在以下行收到警告:

void calculatePos(int **board, int x, int y) {

如何修复错误?

最佳答案

在我声明 calculatePos() 的原型(prototype)后,警告消失了。

关于c - 指针参数警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42026531/

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