C语言 参数名称省略错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12950694/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 04:08:17  来源:igfitidea点击:

Parameter name omitted error?

carraysfunctionmethods

提问by AkshaiShah

I am getting an error when trying to call the method:

尝试调用该方法时出现错误:

int box(int rows, int cols, int [rows][cols])

from the main method using this call:

从使用此调用的主要方法:

box(arrayDimensions, arrayDimensions, array);

But i am not sure what the problem is.

但我不确定问题是什么。

Thanks.

谢谢。

回答by Minion91

int box(int rows, int cols, int [rows][cols])

needs to be

需要是

int box(int rows, int cols, int something[rows][cols])

回答by SpirosMesa

Remember, every variable that you use in the function definition/header needs to have an identifier/name. Like anything else, the array you use needs to have an identifier/name, since it is a variable @AkshaiShah modified your code pretty nicely.

请记住,您在函数定义/头文件中使用的每个变量都需要有一个标识符/名称。像其他任何东西一样,您使用的数组需要有一个标识符/名称,因为它是一个变量 @AkshaiShah 很好地修改了您的代码。