我有这段看似无辜的代码:
void generate_heightmap(float **terrain) {
}
int main(int argc, char **argv) {
float terrain[1500][1500];
generate_heightmap(terrain);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试编译它时,我得到了这些奇怪的错误,这可能是什么原因?
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 ===|
Run Code Online (Sandbox Code Playgroud)
我有GCC 4.6.1和Ubuntu 11.11 64位.