【发布时间】:2012-02-18 21:55:56
【问题描述】:
我有这段看似无辜的代码:
void generate_heightmap(float **terrain) {
}
int main(int argc, char **argv) {
float terrain[1500][1500];
generate_heightmap(terrain);
return 0;
}
但是当我尝试编译它时,我得到了这些奇怪的错误,这可能是什么原因?
test.c||In function ‘main’:|
test.c|8|warning: passing argument 1 of ‘generate_heightmap’ from incompatible pointer type [enabled by default]|
test.c|1|note: expected ‘float **’ but argument is of type ‘float (*)[1500]’|
||=== Build finished: 1 errors, 1 warnings ===|
我有 GCC 4.6.1 和 Ubuntu 11.11 64 位。
【问题讨论】: