void setup_map (int *map); <--- prototype
int row, col; <-- global variables
some main
{
//get number of rows and cols from user
int map[rows][cols]; //create map here because another function uses it
setup_map (map[row][col]);
}
void setup_map (int map[row][col])
{
loop through and set up map
}
Run Code Online (Sandbox Code Playgroud)
我的问题是我不能完全正确地设计原型,我希望有什么地方可以向我解释原型需要是什么?我刚刚开始学习指针,并非常了解这个概念,只是从未使用过2d数组作为参数。谢谢你的帮助。